﻿/* Dashboard - Minimal Design */

#dashboard-container {
    width: 100%;
    max-width: none;
    margin: 2rem 0 4rem;
    padding: 0 2rem;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    overflow-x: hidden;
    min-width: 0;
}

/* Header */
.dashboard-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    overflow-wrap: break-word;
}

.dashboard-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    flex: 1;
    text-align: center;
    min-width: 0;
    overflow-wrap: break-word;
}

.dashboard-header .back-home-btn {
    flex-shrink: 0;
}

/* כפתור חזרה משתמש בסגנון מ-style.css */

/* Sections */

.dashboard-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 1.5rem;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.dashboard-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 1.25rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.dashboard-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 1rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Loyalty Stats */
.loyalty-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    min-width: 0;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 24px;
    min-width: 0;
    overflow-wrap: break-word;
}

.stat-label {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.5rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #45e0f9;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Loyalty Info */
.loyalty-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(69, 224, 249, 0.05);
    border-radius: 24px;
    border: 1px solid rgba(69, 224, 249, 0.15);
    min-width: 0;
    overflow-wrap: break-word;
}

.info-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    min-width: 0;
}

.info-row span {
    font-size: 0.9rem;
    color: #ccc;
    overflow-wrap: break-word;
    word-break: break-word;
}

.info-text {
    font-size: 0.85rem;
    color: #999;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Loyalty History */
.loyalty-history {
    margin-top: 1.5rem;
    min-width: 0;
    overflow-wrap: break-word;
}

#points-history-container {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}

.loading-state {
    text-align: center;
    color: #999;
    padding: 2rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Points History Items (Dynamic) */
.points-history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 3px solid;
    border-radius: 24px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.points-history-item.purchase {
    border-right-color: #28a745;
}

.points-history-item.redemption {
    border-right-color: #ffc107;
}

.points-history-item.bonus {
    border-right-color: #17a2b8;
}

.points-history-item.admin_update {
    border-right-color: #6f42c1;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 1rem;
    min-width: 0;
}

.history-item-type {
    font-weight: 500;
    color: #45e0f9;
    font-size: 0.9rem;
    min-width: 0;
    overflow-wrap: break-word;
    flex-shrink: 1;
}

.history-item-points {
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.history-item-points.positive {
    color: #28a745;
}

.history-item-points.negative {
    color: #ffc107;
}

.history-item-description {
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.history-item-date {
    color: #999;
    font-size: 0.85rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.no-history {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-style: italic;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
    min-width: 0;
    overflow-wrap: break-word;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.form-control {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
}

.form-control:focus {
    outline: none;
    border-color: #45e0f9;
    background: rgba(255, 255, 255, 0.08);
}

.form-control::placeholder {
    color: #666;
}

.form-hint {
    font-size: 0.85rem;
    color: #ffc107;
    margin-top: 0.5rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.form-message {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.form-message.msg-success {
    color: #28a745;
}

.form-message.msg-error {
    color: #ff5252;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: #0085c3;
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Privacy Consents */
.consent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    margin-bottom: 0.75rem;
    gap: 1rem;
    min-width: 0;
}

.consent-info {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
}

.consent-title {
    font-weight: 500;
    color: #fff;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

.consent-date {
    font-size: 0.85rem;
    color: #999;
    overflow-wrap: break-word;
    word-break: break-word;
}

.consent-badge {
    padding: 0.4rem 0.75rem;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}

.consent-badge.approved {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.consent-badge.not-approved {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.consent-controls {
    margin-top: 0.75rem;
    min-width: 0;
    overflow-wrap: break-word;
}

/* Scrollbar */
#points-history-container::-webkit-scrollbar {
    width: 6px;
}

#points-history-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 24px;
}

#points-history-container::-webkit-scrollbar-thumb {
    background: rgba(69, 224, 249, 0.3);
    border-radius: 24px;
}

#points-history-container::-webkit-scrollbar-thumb:hover {
    background: rgba(69, 224, 249, 0.5);
}

/* Responsive */
@media (min-width: 1200px) {
    #dashboard-container {
        margin-right: 240px;
        margin-left: 2rem;
        padding: 0 2.5rem;
        grid-template-columns: repeat(2, 1fr);
        width: calc(100% - 240px - 2rem);
        max-width: calc(100vw - 240px - 4rem);
    }
    
    /* סקשן נקודות נאמנות תופס את כל הרוחב */
    #dashboard-container > section:first-child {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1400px) {
    #dashboard-container {
        padding: 0 3rem;
    }
}

@media (max-width: 1199px) {
    #dashboard-container {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    #dashboard-container {
        padding: 0 0.75rem;
        margin: 1.5rem 0 3rem;
    }

    .dashboard-section {
        padding: 1.25rem;
    }

    .loyalty-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.75rem;
    }

    .stat-label {
        margin: 0;
        font-size: 0.9rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .info-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    #points-history-container {
        max-height: 300px;
    }

    .history-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .consent-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    #points-history-container {
        max-height: 250px;
    }
}
