* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: 
        radial-gradient(circle at 2px 2px, rgba(176, 196, 222, 0.12) 1px, transparent 0),
        radial-gradient(circle at 8px 8px, rgba(230, 230, 250, 0.1) 1px, transparent 0),
        radial-gradient(circle at 14px 14px, rgba(200, 230, 201, 0.08) 1px, transparent 0),
        linear-gradient(135deg, #f5f7fa 0%, #e8f4f8 20%, #e3f2fd 40%, #f1f8e9 60%, #fce4ec 80%, #f3e5f5 100%);
    background-size: 24px 24px, 32px 32px, 28px 28px, 400% 400%;
    animation: gradientShift 25s ease infinite, dotMove 50s linear infinite;
    min-height: 100vh;
    padding: 10px;
    color: #4a5568;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(176, 196, 222, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(200, 230, 201, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(230, 230, 250, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%, 0% 50%, 0% 50%; }
    50% { background-position: 100% 50%, 100% 50%, 100% 50%; }
    100% { background-position: 0% 50%, 0% 50%, 0% 50%; }
}

@keyframes dotMove {
    0% { background-position: 0 0, 0 0, 0 0, 0% 50%; }
    100% { background-position: 20px 20px, -20px -20px, 15px 15px, 100% 50%; }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

header h1 {
    font-size: 2.5em;
    color: #7c8db5;
    font-weight: 700;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quote-btn, .lang-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #a8c5e0 0%, #8bb3d9 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(168, 197, 224, 0.3);
}

.quote-btn:hover, .lang-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 197, 224, 0.5);
}

.quote-display {
    padding: 12px 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    font-style: italic;
    color: #555;
    max-width: 400px;
    min-height: 20px;
}

section {
    margin-bottom: 40px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

section h2 {
    color: #5a7ba8;
    margin-bottom: 20px;
    font-size: 1.8em;
}

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

.section-header h2 {
    margin-bottom: 0;
}

.clear-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.clear-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

.clear-btn:active {
    transform: translateY(0);
}

.music-section {
    text-align: center;
}

.music-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.audio-player {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.audio-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.audio-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, #a8c5e0 0%, #8bb3d9 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    min-width: 150px;
}

.audio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.audio-btn:active {
    transform: translateY(0);
}

.audio-info {
    font-size: 16px;
    color: #555;
    font-weight: 600;
}

#audioStatus {
    color: #a8c5e0;
}

.stats-board {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
}

.stat-label {
    font-weight: 600;
    color: #5a7ba8;
}

.stat-value {
    font-size: 1.2em;
    font-weight: 700;
    color: #5a7ba8;
}

.progress-container {
    margin-top: 20px;
}

.progress-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    text-align: center;
}

.progress-bar {
    position: relative;
    height: 50px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #f8a5c2 0%, #f7dc6f 50%, #a8d5ba 100%);
    transition: width 0.5s ease;
    z-index: 1;
}

.progress-sections {
    position: relative;
    display: flex;
    height: 100%;
    z-index: 2;
}

.progress-section {
    flex: 1;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

.progress-section:last-child {
    border-right: none;
}

.progress-section.completed {
    background: rgba(168, 197, 224, 0.25);
    border-right-color: rgba(168, 197, 224, 0.4);
}

.congrat-message {
    margin-top: 20px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}

.congrat-message.show {
    max-height: 200px;
    padding: 20px;
    opacity: 1;
}

.congrat-content {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #a8c5e0 0%, #8bb3d9 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.congrat-icon {
    font-size: 2.5em;
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.congrat-text {
    flex: 1;
}

.congrat-title {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 8px;
}

.congrat-quote {
    font-size: 1.1em;
    font-style: italic;
    opacity: 0.95;
}

.task-input, .breakdown-input, .url-input, .data-input {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.task-input input, .breakdown-input input, .url-input input, .data-input input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.task-input input:focus, .breakdown-input input:focus, .url-input input:focus, .data-input input:focus {
    outline: none;
    border-color: #a8c5e0;
}

button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #a8c5e0 0%, #8bb3d9 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

/* Green buttons for add actions */
#addTaskBtn, #addStepBtn, #addUrlBtn, #addDataBtn, #startBreakdownBtn {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

#addTaskBtn:hover, #addStepBtn:hover, #addUrlBtn:hover, #addDataBtn:hover, #startBreakdownBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: linear-gradient(135deg, #5a7ba8 0%, #4a6b9a 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.timer-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timer {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    font-weight: 700;
    color: #a8c5e0;
    min-width: 100px;
}

.timer-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #a8c5e0 0%, #8bb3d9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.timer-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.status.incomplete {
    background: #fef3c7;
    color: #d97706;
}

.status.complete {
    background: #d1fae5;
    color: #059669;
}

.action-btn {
    padding: 8px 16px;
    margin: 0 5px;
    font-size: 14px;
    border-radius: 8px;
}

.btn-complete {
    background: linear-gradient(135deg, #a8d5ba, #8bc49f);
}

.btn-delete {
    background: linear-gradient(135deg, #f87171, #ef4444);
}

.breaker-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breaker-controls select {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    cursor: pointer;
}

.breaker-controls select:focus {
    outline: none;
    border-color: #a8c5e0;
}

.breakdown-area {
    margin-top: 20px;
}

a {
    color: #a8c5e0;
    text-decoration: none;
    word-break: break-all;
}

a:hover {
    text-decoration: underline;
}

.disclaimer {
    text-align: center;
    padding: 15px;
    color: #666;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    margin-top: 20px;
}

.avatar-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid #a8c5e0;
    background: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 1000;
    overflow: hidden;
    padding: 0;
}

.avatar-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-window {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 400px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
}

.chat-window.open {
    display: flex;
}

.chat-header {
    background: linear-gradient(135deg, #a8c5e0 0%, #8bb3d9 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.chat-header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.clear-chat-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.clear-chat-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 15px;
    word-wrap: break-word;
    line-height: 1.5;
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #a8c5e0 0%, #8bb3d9 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.chat-message.assistant {
    align-self: flex-start;
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 5px;
}

.chat-message.loading {
    font-style: italic;
    color: #999;
}

.chat-input-container {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input:focus {
    border-color: #a8c5e0;
}

.send-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #a8c5e0 0%, #8bb3d9 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
        border-radius: 15px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    header h1 {
        font-size: 1.8em;
    }
    
    .header-controls {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .quote-btn, .lang-btn {
        width: 100%;
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .quote-display {
        max-width: 100%;
        font-size: 0.9em;
    }

    section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    section h2 {
        font-size: 1.4em;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .clear-btn {
        width: 100%;
    }

    .task-input, .breakdown-input, .url-input, .data-input {
        flex-direction: column;
    }

    .task-input input, .breakdown-input input, .url-input input, .data-input input,
    .task-input button, .breakdown-input button, .url-input button, .data-input button {
        width: 100%;
    }
    
    .breaker-controls {
        flex-direction: column;
    }
    
    .breaker-controls select,
    .breaker-controls button {
        width: 100%;
    }
    
    table {
        font-size: 0.9em;
    }
    
    th, td {
        padding: 10px 8px;
    }
    
    .timer-controls {
        flex-direction: column;
        gap: 5px;
    }
    
    .timer-btn {
        width: 100%;
    }
    
    .progress-bar {
        height: 35px;
    }
    
    .progress-label {
        font-size: 0.9em;
    }
    
    .stat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .audio-player {
        padding: 15px;
    }
    
    .audio-btn {
        width: 100%;
    }
    
    .chat-window {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 90px;
        height: 400px;
        max-height: calc(100vh - 120px);
    }
    
    .chat-header {
        padding: 12px 15px;
    }
    
    .chat-header h3 {
        font-size: 1em;
    }
    
    .chat-messages {
        padding: 15px;
    }
    
    .chat-message {
        max-width: 85%;
        font-size: 0.9em;
        padding: 10px 14px;
    }
    
    .chat-input-container {
        padding: 12px;
        flex-direction: column;
        gap: 8px;
    }
    
    .chat-input {
        width: 100%;
    }
    
    .send-btn {
        width: 100%;
    }
    
    .avatar-btn {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
    
    .disclaimer {
        padding: 10px;
        font-size: 0.85em;
    }
}
