/**
 * Milenecký Azyl - Klientský Dashboard
 */

/* Reset a základní styly */
.ma-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.ma-dashboard * {
    box-sizing: border-box;
}

/* Auth Container */
.ma-auth-container {
    max-width: 420px;
    margin: 40px auto;
}

.ma-auth-box {
    background: #fff;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.ma-auth-box h2 {
    margin: 0 0 25px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
}

.ma-info-text {
    color: #666;
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.ma-auth-links {
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ma-auth-links a {
    color: #aa8b5f;
    text-decoration: none;
    font-size: 14px;
}

.ma-auth-links a:hover {
    text-decoration: underline;
}

/* Form Elements */
.ma-form-group {
    margin-bottom: 18px;
}

.ma-form-group label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    font-size: 14px;
}

.ma-form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s ease;
}

.ma-form-group input:focus {
    outline: none;
    border-color: #aa8b5f;
}

.ma-form-group input[readonly] {
    background: #f5f5f5;
    color: #666;
}

.ma-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

/* Buttons */
.ma-btn {
    display: inline-block;
    padding: 12px 24px;
    border: 2px solid #aa8b5f;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    background: #fff;
    color: #aa8b5f;
}

.ma-btn:hover {
    background: #aa8b5f;
    color: #fff;
}

.ma-btn-primary {
    background: #aa8b5f;
    color: #fff;
    width: 100%;
}

.ma-btn-primary:hover {
    background: #8a7049;
    border-color: #8a7049;
}

.ma-btn-primary:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

.ma-btn-outline {
    background: transparent;
}

.ma-btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.ma-btn-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.ma-btn-danger:hover {
    background: #dc3545;
    color: #fff;
}

.ma-btn-danger:disabled {
    border-color: #ccc;
    color: #ccc;
    cursor: not-allowed;
}

.ma-btn-danger:disabled:hover {
    background: transparent;
    color: #ccc;
}

.ma-btn-outline:disabled,
.ma-btn-change:disabled {
    border-color: #ccc;
    color: #ccc;
    cursor: not-allowed;
}

.ma-btn-outline:disabled:hover,
.ma-btn-change:disabled:hover {
    background: transparent;
    color: #ccc;
}

/* Messages */
.ma-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.ma-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.ma-message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.ma-message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Dashboard Header */
.ma-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.ma-dashboard-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
}

.ma-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #666;
}

/* Tabs */
.ma-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
}

.ma-tab {
    padding: 12px 24px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.ma-tab:hover {
    color: #aa8b5f;
}

.ma-tab.active {
    color: #aa8b5f;
    border-bottom-color: #aa8b5f;
}

.ma-tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Section Header */
.ma-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ma-section-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #333;
}

/* Empty State */
.ma-empty-state {
    text-align: center;
    padding: 50px 20px;
    background: #f9f9f9;
    border-radius: 12px;
}

.ma-empty-state p {
    color: #666;
    margin-bottom: 20px;
}

/* Rezervace List */
.ma-rezervace-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ma-rezervace-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
    border: 1px solid #eee;
}

.ma-rezervace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f6f3 0%, #f0ebe4 100%);
    border-bottom: 1px solid #e8e4dd;
}

.ma-rezervace-id {
    font-weight: 600;
    color: #aa8b5f;
}

.ma-rezervace-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.ma-status-confirmed {
    background: #d4edda;
    color: #155724;
}

.ma-status-pending_payment {
    background: #fff3cd;
    color: #856404;
}

.ma-status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.ma-rezervace-body {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
}

.ma-rezervace-main h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.ma-rezervace-datetime {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.ma-rezervace-datetime > div {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #555;
    font-size: 14px;
}

.ma-icon {
    font-size: 16px;
}

/* Code Box */
.ma-rezervace-code {
    background: linear-gradient(135deg, #aa8b5f 0%, #8a7049 100%);
    color: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 160px;
}

.ma-code-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.ma-code-value {
    display: block;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 3px;
    font-family: monospace;
}

.ma-code-hint {
    display: block;
    font-size: 10px;
    opacity: 0.7;
    margin-top: 8px;
    line-height: 1.3;
}

/* Details */
.ma-rezervace-details {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.ma-detail-item {
    display: flex;
    gap: 6px;
    font-size: 14px;
}

.ma-detail-label {
    color: #888;
}

.ma-detail-value {
    color: #333;
    font-weight: 500;
}

.ma-detail-item.ma-price .ma-detail-value {
    color: #aa8b5f;
    font-size: 16px;
}

/* QR Payment */
.ma-qr-payment {
    grid-column: 1 / -1;
    text-align: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 10px;
}

.ma-qr-payment h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
}

.ma-qr-payment img {
    max-width: 150px;
}

.ma-qr-info {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

/* Actions */
.ma-rezervace-actions {
    padding: 15px 20px;
    background: #fafafa;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.ma-rezervace-actions .ma-btn {
    padding: 10px 18px;
    font-size: 13px;
}

/* Past Rezervace */
.ma-past-rezervace {
    margin-top: 40px;
}

.ma-past-rezervace h3 {
    font-size: 18px;
    color: #888;
    margin-bottom: 15px;
}

.ma-rezervace-list.ma-past .ma-rezervace-card {
    opacity: 0.6;
}

.ma-past-card .ma-rezervace-body {
    padding: 15px 20px;
    display: block;
}

.ma-past-card h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.ma-past-card p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Account Sections */
.ma-account-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.ma-account-box {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #eee;
}

.ma-account-box h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.ma-account-box .ma-btn {
    margin-top: 10px;
}

.ma-message {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Modal */
.ma-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
}

.ma-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.ma-modal-large {
    max-width: 750px;
}

.ma-modal-content h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
}

.ma-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.ma-modal-close:hover {
    color: #333;
}

.ma-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Calendar in Modal */
.ma-datetime-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ma-calendar-wrapper {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
}

.ma-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ma-calendar-header span {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.ma-cal-nav {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #aa8b5f;
    padding: 5px 10px;
}

.ma-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 8px;
}

.ma-calendar-weekdays span {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    padding: 5px;
}

.ma-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.ma-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    border: 1px solid transparent;
}

.ma-cal-day:hover:not(.disabled):not(.empty) {
    border-color: #aa8b5f;
}

.ma-cal-day.selected {
    background: #aa8b5f;
    color: #fff;
}

.ma-cal-day.today {
    border-color: #aa8b5f;
}

.ma-cal-day.disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #f5f5f5;
}

.ma-cal-day.empty {
    background: transparent;
    cursor: default;
}

/* Slots */
.ma-slots-wrapper {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 15px;
}

.ma-slots-wrapper h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
}

.ma-slots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.ma-slots-hint {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    font-style: italic;
    font-size: 14px;
}

.ma-slot {
    padding: 10px;
    border: 2px solid #e8e8e8;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    background: #fff;
}

.ma-slot:hover:not(.disabled) {
    border-color: #aa8b5f;
}

.ma-slot.selected {
    background: #aa8b5f;
    color: #fff;
    border-color: #aa8b5f;
}

.ma-slot.disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .ma-dashboard {
        padding: 15px;
    }
    
    .ma-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .ma-dashboard-header h1 {
        font-size: 24px;
    }
    
    .ma-tabs {
        flex-wrap: wrap;
    }
    
    .ma-tab {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .ma-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .ma-rezervace-body {
        grid-template-columns: 1fr;
    }
    
    .ma-rezervace-code {
        order: -1;
    }
    
    .ma-rezervace-actions {
        flex-direction: column;
    }
    
    .ma-rezervace-actions .ma-btn {
        width: 100%;
    }
    
    .ma-account-sections {
        grid-template-columns: 1fr;
    }
    
    .ma-datetime-container {
        grid-template-columns: 1fr;
    }
    
    .ma-modal-content {
        padding: 20px;
    }
    
    .ma-auth-box {
        padding: 25px 20px;
    }
}

@media screen and (max-width: 480px) {
    .ma-rezervace-datetime {
        flex-direction: column;
        gap: 8px;
    }
    
    .ma-rezervace-details {
        flex-direction: column;
        gap: 8px;
    }
    
    .ma-slots-grid {
        grid-template-columns: 1fr;
    }
}
