/**
 * Dashboard Page Styles
 * Modern, engaging dashboard design with productivity focus
 */

/* Dashboard Main Container */
.dashboard-main {
    min-height: calc(100vh - 64px);
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-surface) 100%);
    padding: 2rem 0;
}

/* Dashboard Header */
.dashboard-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.dashboard-quote {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Hero Section */
.dashboard-hero {
    border-radius: 20px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

/* Logged-in Hero Content */
.hero-content.logged-in-content {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%),
                linear-gradient(rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.3) 100%);
    background-blend-mode: overlay;
    padding: 3rem 2rem;
    color: var(--color-text-on-primary);
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-greeting h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.125rem;
    opacity: 1;
    font-style: italic;
    margin-bottom: 2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.hero-stats {
    display: flex;
    gap: 1.5rem;
    flex-direction: column-reverse;
}

.streak-card, .level-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Non-logged-in Hero Content */
.hero-content.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background: var(--color-surface);
}

.hero-content.video-container #youtubePlayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content.logged-in-content {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem;
        gap: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
    }
}

.streak-icon, .level-icon {
    font-size: 2rem;
}

.streak-info, .level-info {
    display: flex;
    flex-direction: column;
}

.streak-count, .level-count {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.streak-label, .level-label {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.streak-subtitle, .level-subtitle {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.125rem;
    line-height: 1.2;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.productivity-chart {
    width: 100%;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 2rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.action-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--color-primary);
}

.action-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-light);
    border-radius: 12px;
}

.action-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.action-content p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin: 0;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Session Card */
.session-card {
    grid-column: span 4;
}

.card-content {
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    padding-right: 20px;
}

.timer-display {
    text-align: center;
    margin-bottom: 1.5rem;
}

.timer-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    position: relative;
}

.timer-circle.active {
    border-color: var(--color-primary);
    background: conic-gradient(var(--color-primary) 0deg, var(--color-primary) var(--progress-angle, 0deg), transparent var(--progress-angle, 0deg));
}

.timer-time {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.timer-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.session-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-neutral-400);
}

.status-indicator.active {
    background: var(--color-success);
    animation: pulse 2s infinite;
}

.status-indicator.paused {
    background: var(--color-warning);
}

.status-text {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.session-progress {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--color-neutral-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-align: center;
}

/* Overview Card */
.overview-card {
    grid-column: span 8;
}

.date-display {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.overview-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-surface-hover);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.metric-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.metric-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-light);
    border-radius: 10px;
}

.metric-data {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

/* Habits Card */
.habits-card {
    grid-column: span 6;
}

.habits-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.habit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--color-surface-hover);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.habit-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.habit-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.habit-icon {
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-light);
    border-radius: 8px;
}

.habit-details h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.habit-details p {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin: 0;
}

.habit-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.habit-completed {
    color: var(--color-success);
}

.habit-pending {
    color: var(--color-text-secondary);
}

/* Progress Card */
.progress-card {
    grid-column: span 6;
}

.period-selector {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text);
}

.progress-chart {
    height: 120px;
    background: var(--color-surface-hover);
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
}

.progress-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.summary-label {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Goals Card */
.goals-card {
    grid-column: span 6;
}

.goals-progress {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.goal-progress-item {
    padding: 1rem;
    background: var(--color-surface-hover);
    border-radius: 12px;
    border: 1px solid var(--color-border);
}

.goal-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.goal-progress-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

.goal-progress-status {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.goal-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-neutral-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.goal-progress-text {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-align: center;
}

/* Achievements Card */
.achievements-card {
    grid-column: span 6;
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-surface-hover);
    border-radius: 12px;
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.achievement-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.achievement-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 12px;
    color: white;
}

.achievement-content {
    flex: 1;
}

.achievement-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.achievement-content p {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.achievement-date {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* Insights Section */
.insights-section {
    margin-top: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1.5rem;
    text-align: center;
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.insight-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.insight-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.insight-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 12px;
    color: white;
}

.insight-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.insight-content p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin: 0;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.empty-state p {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* All Goals Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-dialog {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    margin: 1rem;
    z-index: 1001;
}

.modal-dialog.modal-lg {
    max-width: 800px;
}

.modal-content {
    background: var(--color-surface);
    border-radius: 16px;
    border: 1px solid var(--color-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-hover);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.modal-close-btn {
    font-size: 1rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 4px;
    font-weight: normal;
    line-height: 1;
    min-width: auto;
    gap: 0 !important;
    flex: 0 !important;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface-hover);
}

/* Goals Container in Modal */
.goals-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.goal-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.goal-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

.goal-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.goal-item-title {
    flex: 1;
}

.goal-item-title h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.goal-item-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.goal-item-status.completed {
    background: var(--color-success-light);
    color: var(--color-success-dark);
}

.goal-item-status.in-progress {
    background: var(--color-warning-light);
    color: var(--color-warning-dark);
}

.goal-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.goal-item-description {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.goal-item-progress {
    margin-bottom: 1rem;
}

.goal-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.goal-item-date {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

/* Responsive Modal Styles */
@media (max-width: 768px) {
    .modal-dialog.modal-lg {
        max-width: 95vw;
        margin: 0.5rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .goal-item {
        padding: 1rem;
    }

    .goal-item-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .goal-item-actions {
        justify-content: flex-end;
    }

    .goal-item-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(8, 1fr);
    }

    .session-card {
        grid-column: span 8;
    }

    .overview-card {
        grid-column: span 8;
    }

    .habits-card,
    .progress-card,
    .goals-card,
    .achievements-card {
        grid-column: span 4;
    }
}

@media (max-width: 768px) {
    .dashboard-hero {
        padding: 2rem 1rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .session-card,
    .overview-card,
    .habits-card,
    .progress-card,
    .goals-card,
    .achievements-card {
        grid-column: span 1;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    .insights-grid {
        grid-template-columns: 1fr;
    }

    .overview-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .hero-greeting h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .dashboard-main {
        padding: 1rem 0;
    }

    .dashboard-hero {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }

    .overview-metrics {
        grid-template-columns: 1fr;
    }

    .metric-item {
        padding: 0.75rem;
    }

    .action-card {
        padding: 1rem;
    }

    .hero-greeting h1 {
        font-size: 1.75rem;
    }
}
