:root {
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --accent: #FD79A8;
    --bg: #0F0F23;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text: #E0E0E0;
    --text-muted: #B0B0B0;
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Cosmos Background */
.cosmos-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at center, #1B1B3A 0%, #0F0F23 100%);
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/123163/stars.png') repeat top center;
    z-index: 0;
}

.twinkle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/123163/twinkling.png') repeat top center;
    z-index: 1;
    animation: move-twink-back 200s linear infinite;
}

@keyframes move-twink-back {
    from { background-position: 0 0; }
    to { background-position: -10000px 5000px; }
}

/* App Container */
.app-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    position: relative;
    z-index: 10;
}

.glass {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header-main h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-main p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.streak-badge {
    background: var(--card-bg);
    border: 1px solid var(--accent);
    padding: 10px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    box-shadow: 0 0 15px rgba(253, 121, 168, 0.2);
    transition: var(--transition);
}

.streak-badge i {
    width: 18px;
    height: 18px;
}

.streak-badge span {
    font-weight: 700;
    font-size: 1.1rem;
}

/* Input Section */
.input-section {
    padding: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

#add-task-form {
    display: flex;
    gap: 10px;
}

#task-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px 15px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

#task-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.add-btn {
    background: var(--primary);
    border: none;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.add-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

/* Tasks Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}

#task-progress {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 15px;
    animation: slide-in 0.3s ease-out;
    transition: var(--transition);
}

@keyframes slide-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.task-text {
    flex: 1;
    font-size: 1rem;
    transition: var(--transition);
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Custom Checkbox */
.checkbox-container {
    display: block;
    position: relative;
    width: 24px;
    height: 24px;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 24px;
    width: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--card-border);
    border-radius: 6px;
    transition: var(--transition);
}

.checkbox-container:hover input ~ .checkmark {
    background-color: rgba(255, 255, 255, 0.15);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 8px;
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Delete Button */
.delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    opacity: 0;
    transition: var(--transition);
}

.task-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: var(--accent);
    background: rgba(253, 121, 168, 0.1);
}

/* Archive Section */
.archive-section {
    margin-top: 40px;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
    transition: var(--transition);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.hidden {
    display: none;
}

.archive-content {
    margin-top: 20px;
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.archive-item {
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 480px) {
    .app-container {
        padding: 10px;
        margin: 20px auto;
    }
    
    .header-main h1 {
        font-size: 1.5rem;
    }
    
    .streak-badge {
        padding: 8px 12px;
    }
}
