/* Study Page - Material Design */
page[data-hash="study"] {
    .study-page {
        background: #f5f5f5;
        min-height: 100vh;
    }
    
    /* Action Bar */
    .action-bar {
        background: white;
        padding: 1.5rem;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* Timer Indicator */
    .timer-indicator {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
        color: white;
    }
    
    .timer-indicator.pulsing {
        animation: pulse 2s ease-in-out infinite;
    }
    
    @keyframes pulse {
        0%, 100% { transform: scale(1); opacity: 1; }
        50% { transform: scale(1.1); opacity: 0.8; }
    }
    
    /* Elevated Button */
    .btn-elevated {
        background: white;
        border: 1px solid #e0e0e0;
        padding: 0.5rem 1rem;
        border-radius: 4px;
        font-weight: 500;
        transition: all 0.3s ease;
        color: #424242;
        cursor: pointer;
    }
    
    .btn-elevated:hover {
        background: #f5f5f5;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    /* Material Card */
    .material-card {
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        overflow: hidden;
    }
    
    .card-header-material {
        padding: 1.25rem 1.5rem;
        border-bottom: 1px solid #e0e0e0;
        font-weight: 600;
        font-size: 1rem;
        color: #212121;
    }
    
    .card-body-material {
        padding: 1.5rem;
    }
    
    /* Timer Card */
    .timer-card {
        background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    }
    
    .timer-container {
        padding: 2rem;
    }
    
    .timer-display {
        display: flex;
        justify-content: center;
        margin-bottom: 2rem;
    }
    
    .timer-circle {
        position: relative;
        width: 280px;
        height: 280px;
    }
    
    .timer-svg {
        width: 100%;
        height: 100%;
        transform: rotate(-90deg);
    }
    
    .timer-track {
        fill: none;
        stroke: rgba(255, 255, 255, 0.2);
        stroke-width: 8;
    }
    
    .timer-progress {
        fill: none;
        stroke: white;
        stroke-width: 8;
        stroke-linecap: round;
        transition: stroke-dashoffset 1s linear;
    }
    
    .timer-content {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        color: white;
    }
    
    .timer-time {
        font-size: 4rem;
        font-weight: 300;
        line-height: 1;
        margin-bottom: 0.5rem;
    }
    
    .timer-label {
        font-size: 1rem;
        font-weight: 500;
        opacity: 0.9;
    }
    
    /* Timer Controls */
    .timer-controls {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .btn-timer-primary {
        padding: 1rem 2rem;
        background: white;
        color: #1976d2;
        border: none;
        border-radius: 50px;
        font-weight: 600;
        font-size: 1.125rem;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .btn-timer-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0,0,0,0.25);
    }
    
    .btn-timer-secondary {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        color: white;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .btn-timer-secondary:hover {
        background: rgba(255, 255, 255, 0.3);
    }
    
    /* Timer Modes */
    .timer-modes {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .mode-btn {
        padding: 1rem;
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid transparent;
        border-radius: 8px;
        color: white;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .mode-btn:hover {
        background: rgba(255, 255, 255, 0.15);
    }
    
    .mode-btn.active {
        background: rgba(255, 255, 255, 0.2);
        border-color: white;
    }
    
    .mode-btn i {
        font-size: 1.5rem;
    }
    
    .mode-time {
        font-size: 0.75rem;
        opacity: 0.8;
    }
    
    /* Subject Selector */
    .subject-selector {
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .subject-selector .input-label {
        color: white;
        margin-bottom: 1rem;
        font-weight: 500;
    }
    
    .btn-text-white {
        background: transparent;
        border: none;
        color: white;
        font-size: 0.875rem;
        font-weight: 500;
        cursor: pointer;
        padding: 0.25rem 0.5rem;
        transition: all 0.2s ease;
        border-radius: 4px;
    }
    
    .btn-text-white:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .subject-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.75rem;
    }
    
    .subject-chip {
        padding: 0.75rem 1rem;
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid transparent;
        border-radius: 8px;
        color: white;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        font-weight: 500;
    }
    
    .subject-chip:hover {
        background: rgba(255, 255, 255, 0.15);
    }
    
    .subject-chip.active {
        background: white;
        color: #1976d2;
    }
    
    /* Stat Cards */
    .stat-card {
        background: white;
        padding: 1.25rem;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        text-align: center;
        transition: transform 0.2s ease;
    }
    
    .stat-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .stat-card .stat-icon {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 0.75rem;
        font-size: 1.25rem;
        color: white;
    }
    
    .stat-icon.blue { background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%); }
    .stat-icon.green { background: linear-gradient(135deg, #388e3c 0%, #2e7d32 100%); }
    .stat-icon.purple { background: linear-gradient(135deg, #7b1fa2 0%, #6a1b9a 100%); }
    .stat-icon.orange { background: linear-gradient(135deg, #f57c00 0%, #ef6c00 100%); }
    
    .stat-card .stat-value {
        font-size: 2rem;
        font-weight: bold;
        color: #212121;
        line-height: 1;
        margin-bottom: 0.25rem;
    }
    
    .stat-card .stat-label {
        font-size: 0.875rem;
        color: #757575;
        font-weight: 500;
    }
    
    /* Chip Button */
    .chip-button {
        padding: 0.375rem 0.875rem;
        background: transparent;
        border: 1px solid #e0e0e0;
        border-radius: 16px;
        font-size: 0.8125rem;
        font-weight: 500;
        color: #757575;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .chip-button:hover {
        background: #f5f5f5;
    }
    
    .chip-button.active {
        background: #1976d2;
        border-color: #1976d2;
        color: white;
    }
    
    /* Subject Time Item */
    .subject-time-item {
        padding: 1.25rem 0;
        border-bottom: 1px solid #f5f5f5;
    }
    
    .subject-time-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .subject-time-item:first-child {
        padding-top: 0;
    }
    
    .subject-time-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.75rem;
    }
    
    .subject-info {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .subject-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        color: white;
    }
    
    .subject-icon.english { background: #5e35b1; }
    .subject-icon.math { background: #1976d2; }
    .subject-icon.science { background: #00897b; }
    .subject-icon.history { background: #d84315; }
    
    .subject-name {
        font-weight: 600;
        color: #212121;
        margin-bottom: 0.25rem;
    }
    
    .subject-sessions {
        font-size: 0.8125rem;
        color: #757575;
    }
    
    .subject-time-value {
        text-align: right;
    }
    
    .time-display {
        font-size: 1.25rem;
        font-weight: 600;
        color: #212121;
        margin-bottom: 0.25rem;
    }
    
    .time-percentage {
        font-size: 0.875rem;
        color: #757575;
    }
    
    .subject-progress-bar {
        height: 8px;
        background: #f5f5f5;
        border-radius: 4px;
        overflow: hidden;
    }
    
    .progress-fill {
        height: 100%;
        border-radius: 4px;
        transition: width 0.3s ease;
    }
    
    .progress-fill.english { background: #5e35b1; }
    .progress-fill.math { background: #1976d2; }
    .progress-fill.science { background: #00897b; }
    .progress-fill.history { background: #d84315; }
    
    /* Sessions List */
    .sessions-list {
        padding: 0;
    }
    
    .session-item {
        display: flex;
        align-items: center;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #f5f5f5;
        transition: background 0.2s ease;
    }
    
    .session-item:last-child {
        border-bottom: none;
    }
    
    .session-item:hover {
        background: #fafafa;
    }
    
    .session-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        color: white;
        margin-right: 1rem;
    }
    
    .session-icon.english { background: #5e35b1; }
    .session-icon.math { background: #1976d2; }
    .session-icon.science { background: #00897b; }
    
    .session-content {
        flex: 1;
    }
    
    .session-subject {
        font-weight: 600;
        color: #212121;
        margin-bottom: 0.25rem;
    }
    
    .session-time {
        font-size: 0.8125rem;
        color: #757575;
    }
    
    .session-badge {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.75rem;
    }
    
    .session-badge.completed {
        background: #e8f5e9;
        color: #2e7d32;
    }
    
    .session-badge.interrupted {
        background: #ffebee;
        color: #c62828;
    }
    
    /* AI Card */
    .ai-card .card-header-material {
        background: linear-gradient(135deg, #7b1fa2 0%, #6a1b9a 100%);
        color: white;
        border-bottom: none;
    }
    
    .ai-prompt {
        display: flex;
        gap: 1rem;
        margin-bottom: 1.5rem;
        padding: 1rem;
        background: #f3e5f5;
        border-radius: 8px;
    }
    
    .ai-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: linear-gradient(135deg, #7b1fa2 0%, #6a1b9a 100%);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        flex-shrink: 0;
    }
    
    .ai-text {
        margin: 0;
        color: #4a148c;
        font-size: 0.875rem;
        line-height: 1.5;
    }
    
    .btn-primary-material {
        width: 100%;
        padding: 0.75rem 1.5rem;
        background: #1976d2;
        color: white;
        border: none;
        border-radius: 4px;
        font-weight: 600;
        font-size: 1rem;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    
    .btn-primary-material:hover {
        background: #1565c0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.25);
    }
    
    .ai-info {
        text-align: center;
        font-size: 0.8125rem;
        color: #757575;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Icon Button */
    .icon-button {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: none;
        background: transparent;
        color: #757575;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        cursor: pointer;
    }
    
    .icon-button:hover {
        background: #f5f5f5;
        color: #212121;
    }
    
    .icon-button-small {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        border: none;
        background: transparent;
        color: #9e9e9e;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        cursor: pointer;
        font-size: 0.75rem;
    }
    
    .icon-button-small:hover {
        background: #f5f5f5;
        color: #424242;
    }
    
    /* Goal Item */
    .goal-item {
        padding: 1.25rem 1.5rem;
        border-bottom: 1px solid #f5f5f5;
    }
    
    .goal-item:last-child {
        border-bottom: none;
    }
    
    .goal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
    }
    
    .goal-subject {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-weight: 600;
        color: #212121;
    }
    
    .goal-subject.english { color: #5e35b1; }
    .goal-subject.math { color: #1976d2; }
    .goal-subject.science { color: #00897b; }
    .goal-subject.history { color: #d84315; }
    
    .goal-progress {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 0.75rem;
        align-items: center;
    }
    
    .goal-times {
        font-size: 0.875rem;
        white-space: nowrap;
    }
    
    .goal-current {
        font-weight: 600;
        color: #212121;
    }
    
    .goal-target {
        color: #9e9e9e;
    }
    
    .goal-bar {
        height: 8px;
        background: #f5f5f5;
        border-radius: 4px;
        overflow: hidden;
    }
    
    .goal-fill {
        height: 100%;
        border-radius: 4px;
        transition: width 0.3s ease;
    }
    
    .goal-fill.english { background: #5e35b1; }
    .goal-fill.math { background: #1976d2; }
    .goal-fill.science { background: #00897b; }
    .goal-fill.history { background: #d84315; }
    
    .goal-percentage {
        font-size: 0.875rem;
        font-weight: 600;
        color: #424242;
        min-width: 40px;
        text-align: right;
    }
    
    /* Week Stats */
    .week-stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 0;
        border-bottom: 1px solid #f5f5f5;
    }
    
    .week-stat:last-of-type {
        border-bottom: none;
        margin-bottom: 1.5rem;
    }
    
    .week-stat-label {
        font-size: 0.875rem;
        color: #757575;
        font-weight: 500;
    }
    
    .week-stat-value {
        font-size: 1.125rem;
        font-weight: 600;
        color: #212121;
    }
    
    /* Week Chart */
    .week-chart {
        margin-top: 1.5rem;
    }
    
    .week-bar-chart {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        height: 120px;
        gap: 0.5rem;
    }
    
    .week-bar {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .bar-fill {
        width: 100%;
        background: linear-gradient(180deg, #1976d2 0%, #1565c0 100%);
        border-radius: 4px 4px 0 0;
        height: 100%;
        transition: height 0.3s ease;
    }
    
    .bar-label {
        font-size: 0.75rem;
        font-weight: 600;
        color: #757575;
    }
    
    /* Input Label */
    .input-label {
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.875rem;
        font-weight: 500;
        color: #424242;
    }
    
    /* Material Input */
    .material-input {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        font-size: 1rem;
        transition: all 0.2s ease;
    }
    
    .material-input:focus {
        outline: none;
        border-color: #1976d2;
        box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
    }
    
    /* Autocomplete Wrapper */
    .autocomplete-wrapper {
        position: relative;
    }
    
    .autocomplete-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border: 1px solid #e0e0e0;
        border-top: none;
        border-radius: 0 0 4px 4px;
        max-height: 300px;
        overflow-y: auto;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        z-index: 1000;
        display: none;
    }
    
    .autocomplete-dropdown.show {
        display: block;
    }
    
    .autocomplete-item {
        padding: 0.75rem 1rem;
        cursor: pointer;
        transition: background 0.2s ease;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .autocomplete-item:hover {
        background: #f5f5f5;
    }
    
    .autocomplete-item i {
        color: #1976d2;
        font-size: 1rem;
    }
    
    /* Icon Grid */
    .icon-grid {
        display: grid;
        grid-template-columns: repeat(8, 1fr);
        gap: 0.5rem;
    }
    
    .icon-option {
        width: 48px;
        height: 48px;
        border: 2px solid #e0e0e0;
        border-radius: 8px;
        background: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        color: #757575;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .icon-option:hover {
        background: #f5f5f5;
        border-color: #bdbdbd;
    }
    
    .icon-option.active {
        background: #e3f2fd;
        border-color: #1976d2;
        color: #1976d2;
    }
    
    /* Modal Overrides */
    .modal-content {
        border-radius: 8px;
        border: none;
    }
    
    .modal-header {
        border-bottom: 1px solid #e0e0e0;
        padding: 1.5rem;
    }
    
    .modal-title {
        font-weight: 600;
        color: #212121;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        border-top: 1px solid #e0e0e0;
        padding: 1rem 1.5rem;
    }
    
    /* Responsive */
    @media (max-width: 991px) {
        .action-bar {
            flex-direction: column;
            gap: 1rem;
            align-items: flex-start;
        }
        
        .timer-circle {
            width: 220px;
            height: 220px;
        }
        
        .timer-time {
            font-size: 3rem;
        }
        
        .timer-modes {
            grid-template-columns: 1fr;
        }
        
        .subject-grid {
            grid-template-columns: repeat(2, 1fr);
        }
        
        .icon-grid {
            grid-template-columns: repeat(6, 1fr);
        }
    }
    
    @media (max-width: 576px) {
        .timer-controls {
            flex-wrap: wrap;
        }
        
        .btn-timer-primary {
            width: 100%;
            justify-content: center;
        }
        
        .icon-grid {
            grid-template-columns: repeat(4, 1fr);
        }
    }
}
