/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

/* Logo Styles */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: #718096;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.logo-icon svg {
    width: 20px;
    height: 20px;
}

.logo-text {
    font-size: 1.4em;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-tab {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 15px 25px;
    font-size: 1.1em;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tab:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.nav-tab.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Main Content */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Spline viewer section */
.spline-section {
    margin-bottom: 30px;
}

.spline-viewer-wrap {
    position: relative;
    width: 100%;
    height: 360px;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #0f172a;
}

spline-viewer {
    width: 100%;
    height: 100%;
    display: block;
}

@media (max-width: 768px) {
    .spline-viewer-wrap { height: 280px; }
}

.tool-section {
    display: none;
}

.tool-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tool-header h2 {
    font-size: 2em;
    font-weight: 600;
    color: #1e293b;
}

/* Stats Display */
.todo-stats, .flashcard-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 15px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.stat-number {
    font-size: 1.8em;
    font-weight: 700;
    color: #4f46e5;
}

.stat-label {
    font-size: 0.9em;
    color: #64748b;
    font-weight: 500;
}

/* To-Do List Styles */
.todo-input-section {
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}

#todo-input {
    flex: 1;
    min-width: 250px;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

#todo-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#priority-select {
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1em;
    background: white;
    cursor: pointer;
}

#add-todo-btn {
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

#add-todo-btn:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.todo-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-btn {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.filter-btn.active {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.todo-list {
    margin-bottom: 25px;
    max-height: 500px;
    overflow-y: auto;
}

.todo-item {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.todo-item:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.todo-item.completed {
    background: #f0fdf4;
    border-color: #22c55e;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: #6b7280;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4f46e5;
}

.todo-text {
    flex: 1;
    font-size: 1.1em;
    word-break: break-word;
}

.todo-priority {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-high {
    background: #fee2e2;
    color: #dc2626;
}

.priority-medium {
    background: #fef3c7;
    color: #d97706;
}

.priority-low {
    background: #e0f2fe;
    color: #0284c7;
}

.todo-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.action-btn.danger {
    background: #dc2626;
}

.action-btn.danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.delete-btn {
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #b91c1c;
}

/* Flashcards Styles */
.flashcard-creation {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.flashcard-creation h3 {
    color: #1e293b;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.card-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: end;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-field label {
    font-weight: 600;
    color: #374151;
}

.input-field textarea {
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.input-field textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#add-card-btn {
    background: #10b981;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
}

#add-card-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.flashcard-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    margin-bottom: 25px;
}

.no-cards-message {
    text-align: center;
    color: #6b7280;
    padding: 60px 30px;
}

.no-cards-message i {
    font-size: 4em;
    margin-bottom: 20px;
    color: #d1d5db;
}

.no-cards-message p {
    font-size: 1.2em;
}

.flashcard {
    width: 400px;
    height: 250px;
    perspective: 1000px;
    cursor: pointer;
}

.card-content {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.flashcard.flipped .card-content {
    transform: rotateY(180deg);
}

.card-side {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
}

.card-side.front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card-side.back {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    transform: rotateY(180deg);
}

.card-text {
    font-size: 1.2em;
    line-height: 1.5;
    font-weight: 500;
    word-wrap: break-word;
    max-width: 100%;
}

.card-flip-indicator {
    text-align: center;
    margin-top: 15px;
    color: #6b7280;
    font-size: 0.9em;
}

.flashcard-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.flashcard-controls button {
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flashcard-controls button:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.flashcard-controls button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.flashcard-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Timer Styles */
.timer-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.timer-tab {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timer-tab:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.timer-tab.active {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.timer-container {
    display: none;
}

.timer-container.active {
    display: block;
}

.timer-display {
    text-align: center;
    margin-bottom: 30px;
}

.timer-circle {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto 20px;
}

.timer-progress {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-progress-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 6;
}

.timer-progress-fill {
    fill: none;
    stroke: #4f46e5;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s linear;
}

.timer-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5em;
    font-weight: 700;
    color: #1e293b;
}

.timer-status {
    font-size: 1.3em;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 10px;
}

.timer-session-info {
    font-size: 1.1em;
    color: #64748b;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.timer-btn {
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 25px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.timer-btn.primary {
    background: #10b981;
}

.timer-btn.primary:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.timer-settings {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
}

.timer-settings h4 {
    margin-bottom: 20px;
    color: #1e293b;
    font-size: 1.2em;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.setting-group label {
    font-weight: 600;
    color: #374151;
    min-width: 120px;
}

.setting-group input[type="number"] {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    width: 80px;
    text-align: center;
}

.setting-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #4f46e5;
}

.custom-timer-input {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
}

.time-inputs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.time-input-group input {
    width: 80px;
    padding: 12px;
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
}

.time-input-group label {
    font-weight: 600;
    color: #64748b;
}

#set-custom-timer-btn {
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
}

#set-custom-timer-btn:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .tool-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .card-input-group {
        grid-template-columns: 1fr;
    }
    
    .flashcard {
        width: 100%;
        max-width: 350px;
    }
    
    .timer-circle {
        width: 200px;
        height: 200px;
    }
    
    .timer-time {
        font-size: 2em;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    #todo-input {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .nav-tabs {
        flex-direction: column;
    }
    
    .nav-tab {
        text-align: center;
    }
    
    .todo-stats, .flashcard-stats {
        justify-content: center;
    }
    
    .time-inputs {
        flex-direction: column;
        align-items: center;
    }
}

/* Animation for timer running */
.timer-running .timer-progress-fill {
    stroke: #10b981;
}

.timer-break .timer-progress-fill {
    stroke: #f59e0b;
}

.timer-finished .timer-progress-fill {
    stroke: #dc2626;
}

/* Pulse animation for timer end */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.timer-finished .timer-circle {
    animation: pulse 1s ease-in-out infinite;
}

/* Smooth transitions */
* {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Focus styles for accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(79, 70, 229, 0.5);
    outline-offset: 2px;
}
