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

:root {
    /* Default theme - Emerald Green */
    --theme-primary: 16, 185, 129;
    --theme-primary-dark: 5, 150, 105;
    --theme-primary-darker: 6, 78, 59;
}

:root[data-theme="green"] {
    --theme-primary: 16, 185, 129;
    --theme-primary-dark: 5, 150, 105;
    --theme-primary-darker: 6, 78, 59;
}

:root[data-theme="blue"] {
    --theme-primary: 59, 130, 246;
    --theme-primary-dark: 37, 99, 235;
    --theme-primary-darker: 30, 58, 138;
}

:root[data-theme="purple"] {
    --theme-primary: 168, 85, 247;
    --theme-primary-dark: 147, 51, 234;
    --theme-primary-darker: 88, 28, 135;
}

:root[data-theme="orange"] {
    --theme-primary: 249, 115, 22;
    --theme-primary-dark: 234, 88, 12;
    --theme-primary-darker: 124, 45, 18;
}

:root[data-theme="cyan"] {
    --theme-primary: 6, 182, 212;
    --theme-primary-dark: 8, 145, 178;
    --theme-primary-darker: 22, 78, 99;
}

:root[data-theme="pink"] {
    --theme-primary: 236, 72, 153;
    --theme-primary-dark: 219, 39, 119;
    --theme-primary-darker: 131, 24, 67;
}

:root[data-theme="red"] {
    --theme-primary: 239, 68, 68;
    --theme-primary-dark: 220, 38, 38;
    --theme-primary-darker: 127, 29, 29;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0e1a;
    background-image: 
        radial-gradient(ellipse at top, rgba(var(--theme-primary), 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(var(--theme-primary-darker), 0.05) 0%, transparent 50%);
    color: #e0e6f0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background-image 0.5s ease;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

:root[data-mode="light"] body {
    background: #f5f6f9;
    background-image:
        radial-gradient(ellipse at top, rgba(var(--theme-primary), 0.07) 0%, transparent 58%),
        radial-gradient(ellipse at bottom, rgba(var(--theme-primary-darker), 0.05) 0%, transparent 62%);
    color: #1f2937;
}

:root[data-mode="light"] .card,
:root[data-mode="light"] .mobile-settings-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 248, 252, 0.93) 100%);
    border: 1px solid rgba(170, 182, 198, 0.5);
    box-shadow:
        0 8px 28px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

:root[data-mode="light"] .stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(246, 248, 252, 0.92) 100%);
    border: 1px solid rgba(170, 182, 198, 0.45);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

:root[data-mode="light"] .action-button {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 248, 252, 0.96) 100%);
    border: 1px solid rgba(170, 182, 198, 0.6);
    color: #1f2937;
    box-shadow:
        0 2px 10px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

:root[data-mode="light"] .stat-toggle {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(170, 182, 198, 0.5);
}

:root[data-mode="light"] .stat-toggle:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(var(--theme-primary), 0.5);
}

:root[data-mode="light"] input[type="text"],
:root[data-mode="light"] input[type="number"],
:root[data-mode="light"] select {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 248, 252, 0.96) 100%);
    border: 1px solid rgba(170, 182, 198, 0.6);
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

:root[data-mode="light"] select option {
    background: #ffffff;
    color: #1f2937;
}

:root[data-mode="light"] .settings-code-input {
    background: rgba(249, 250, 252, 0.95);
    border: 1px solid rgba(170, 182, 198, 0.6);
    color: #1f2937;
}

:root[data-mode="light"] .subtitle,
:root[data-mode="light"] .stat-label,
:root[data-mode="light"] .cost-status,
:root[data-mode="light"] .settings-code-hint,
:root[data-mode="light"] .settings-code-toggle,
:root[data-mode="light"] .input-label {
    color: #556171;
}

:root[data-mode="light"] .icon,
:root[data-mode="light"] .currency-icon {
    color: #6b7280;
}

:root[data-mode="light"] .mini-label {
    color: #6b7280;
}

:root[data-mode="light"] .cost-amount,
:root[data-mode="light"] .stat-value {
    color: #1f2937;
    text-shadow: 0 0 22px rgba(var(--theme-primary), 0.32);
}

:root[data-mode="light"] .logo-image {
    filter: drop-shadow(0 0 15px rgba(var(--theme-primary), 0.2));
}

:root[data-mode="light"] .logo-image:hover {
    filter: drop-shadow(0 0 25px rgba(var(--theme-primary), 0.35));
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

header {
    position: relative;
    margin-bottom: 40px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.header-logo {
    flex-shrink: 0;
}

.logo-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(var(--theme-primary), 0.3));
    transition: all 0.3s ease;
}

.logo-image:hover {
    filter: drop-shadow(0 0 30px rgba(var(--theme-primary), 0.5));
    transform: scale(1.05);
}

.header-text {
    text-align: center;
    flex: 1;
    min-width: 250px;
}

.title-first-word {
    font-weight: 700;
}

:root[data-mode="dark"] .title-first-word {
    color: #ffffff;
}

:root[data-mode="light"] .title-first-word {
    color: #1a1a1a;
}

.header-highlight {
    color: rgb(var(--theme-primary));
    font-weight: 600;
}

:root[data-mode="light"] .header-highlight {
    color: rgb(var(--theme-primary));
    font-weight: 700;
}

.hamburger-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1000;
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background: rgba(var(--theme-primary), 1);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-settings-panel {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.8) 0%, rgba(17, 24, 39, 0.6) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 40px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: visible;
}

.mobile-settings-panel.open {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #ffffff;
}

.subtitle {
    font-size: 1.125rem;
    color: #9ca3af;
}

.card {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.8) 0%, rgba(17, 24, 39, 0.6) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 40px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
}

.card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        transparent 100%);
}

.input-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(75, 85, 99, 0.15);
    position: relative;
}

.input-group::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgb(var(--theme-primary)), transparent);
    transition: width 0.3s;
}

.input-group:hover::after {
    width: 100%;
}

.input-group:last-of-type {
    border-bottom: none;
    margin-bottom: 24px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 24px;
    margin-bottom: 24px;
}

.settings-grid .input-group {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.settings-grid .input-label {
    font-size: 0.9rem;
}

.settings-grid .input-controls {
    width: 100%;
    max-width: 100%;
}

.settings-grid .input-controls input,
.settings-grid .input-controls select {
    width: 100%;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    color: #e0e6f0;
}

.icon {
    width: 20px;
    height: 20px;
    color: #9ca3af;
}

.currency-icon {
    width: 20px;
    height: 20px;
    color: #9ca3af;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.input-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    max-width: 70%;
}

.input-controls select {
    flex: 1;
    min-width: 120px;
}

.custom-salary-input {
    flex: 1;
    min-width: 100px;
}

.input-controls.theme-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 100%;
}

.theme-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mini-label {
    font-size: 0.75rem;
    color: #9ca3af;
    letter-spacing: 0.2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.input-controls input[type="text"],
.input-controls input[type="number"],
.input-controls select {
    width: 100%;
}

input[type="text"],
input[type="number"],
select {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9) 0%, rgba(17, 24, 39, 0.9) 100%);
    border: 1px solid rgba(75, 85, 99, 0.6);
    border-radius: 8px;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 1rem;
    min-width: 100px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(255, 255, 255, 0.02);
}

select option {
    background: rgba(17, 24, 39, 1);
    color: #ffffff;
    padding: 8px;
}

input[type="text"] {
    cursor: text;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: rgba(var(--theme-primary), 0.8);
    box-shadow: 
        0 0 0 3px rgba(var(--theme-primary), 0.15),
        0 2px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

input[type="text"]:hover,
input[type="number"]:hover,
select:hover {
    border-color: rgba(var(--theme-primary), 0.5);
    box-shadow: 
        0 2px 12px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

input[type="text"]::placeholder {
    color: #6b7280;
    opacity: 1;
}

.link-button {
    background: none;
    border: none;
    color: #60a5fa;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
}

.link-button:hover {
    color: #93c5fd;
}

.start-button {
    width: 100%;
    background: linear-gradient(135deg, rgb(var(--theme-primary)) 0%, rgb(var(--theme-primary-dark)) 100%);
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s, background 0.5s ease;
    box-shadow: 
        0 4px 20px rgba(var(--theme-primary), 0.4),
        0 8px 32px rgba(var(--theme-primary), 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.start-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left 0.5s;
}

.start-button:hover::before {
    left: 100%;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(var(--theme-primary), 0.4);
}

.start-button:active {
    transform: translateY(0);
}

.start-button.stop {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 
        0 4px 20px rgba(239, 68, 68, 0.4),
        0 8px 32px rgba(239, 68, 68, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.start-button.stop:hover {
    box-shadow: 
        0 6px 25px rgba(239, 68, 68, 0.5),
        0 10px 40px rgba(239, 68, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.start-button.pause {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 
        0 4px 20px rgba(245, 158, 11, 0.4),
        0 8px 32px rgba(245, 158, 11, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.start-button.pause:hover {
    box-shadow: 
        0 6px 25px rgba(245, 158, 11, 0.5),
        0 10px 40px rgba(245, 158, 11, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.start-button.resume {
    background: linear-gradient(135deg, rgb(var(--theme-primary)) 0%, rgb(var(--theme-primary-dark)) 100%);
    box-shadow: 
        0 4px 20px rgba(var(--theme-primary), 0.4),
        0 8px 32px rgba(var(--theme-primary), 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.start-button.resume:hover {
    box-shadow: 
        0 6px 25px rgba(var(--theme-primary), 0.5),
        0 10px 40px rgba(var(--theme-primary), 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.button-icon {
    width: 18px;
    height: 18px;
}

.total-cost {
    text-align: center;
    margin: 60px 0;
    position: relative;
    padding: 40px;
    background: radial-gradient(ellipse at center, rgba(var(--theme-primary), 0.03) 0%, transparent 70%);
}

.cost-amount {
    font-size: 5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 
        0 0 30px rgba(var(--theme-primary), 0.6),
        0 0 60px rgba(var(--theme-primary), 0.3),
        0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 8px;
    letter-spacing: -2px;
    position: relative;
}

.cost-amount::after {
    content: attr(data-glow);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    text-shadow: 
        0 0 40px rgba(var(--theme-primary), 0.8),
        0 0 80px rgba(var(--theme-primary), 0.4);
    opacity: 0;
    transition: opacity 0.3s;
}

.cost-amount.active {
    animation: pulse 2s ease-in-out infinite;
}

.cost-amount.active::after {
    opacity: 0.3;
}

@keyframes pulse {
    0%, 100% {
        text-shadow: 
            0 0 30px rgba(var(--theme-primary), 0.6),
            0 0 60px rgba(var(--theme-primary), 0.3),
            0 2px 4px rgba(0, 0, 0, 0.5);
    }
    50% {
        text-shadow: 
            0 0 40px rgba(var(--theme-primary), 0.8),
            0 0 80px rgba(var(--theme-primary), 0.5),
            0 0 120px rgba(var(--theme-primary), 0.2),
            0 2px 4px rgba(0, 0, 0, 0.5);
    }
}

.cost-status {
    font-size: 1.125rem;
    color: #9ca3af;
    transition: color 0.3s ease;
}

.cost-status.rising {
    color: rgb(var(--theme-primary));
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.6) 0%, rgba(17, 24, 39, 0.4) 100%);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.08) 50%, 
        transparent 100%);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.04) 50%, 
        transparent 100%);
}

.stat-card:hover {
    border-color: rgba(var(--theme-primary), 0.5);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(var(--theme-primary), 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.875rem;
    color: #9ca3af;
}

.stat-card-toggle {
    position: relative;
}

.stat-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-toggle:hover {
    background: rgba(var(--theme-primary), 0.2);
    border-color: rgba(var(--theme-primary), 0.5);
    transform: scale(1.05);
}

.stat-toggle:active {
    transform: scale(0.95);
}

.toggle-icon {
    width: 16px;
    height: 16px;
    color: rgba(var(--theme-primary), 1);
}

.settings-code-toggle-wrapper {
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid rgba(75, 85, 99, 0.2);
}

.settings-code-toggle {
    width: 100%;
    background: transparent;
    border: none;
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #9ca3af;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-code-toggle:hover {
    color: rgba(var(--theme-primary), 1);
}

.settings-code-toggle .icon {
    width: 18px;
    height: 18px;
    color: rgba(var(--theme-primary), 0.7);
    transition: color 0.2s;
}

.settings-code-toggle:hover .icon {
    color: rgba(var(--theme-primary), 1);
}

.settings-code-toggle .chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    color: #9ca3af;
    transition: transform 0.3s ease, color 0.2s;
}

.settings-code-toggle:hover .chevron {
    color: rgba(var(--theme-primary), 1);
}

.settings-code-toggle.expanded .chevron {
    transform: rotate(180deg);
}

.settings-code-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.settings-code-section.expanded {
    max-height: 650px;
    opacity: 1;
    padding-top: 16px;
    padding-bottom: 20px;
}

.settings-code-section .input-group {
    margin-bottom: 16px;
}

.settings-code-hint {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 12px;
}

.settings-code-input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.settings-code-input {
    flex: 1;
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 8px;
    padding: 12px 16px;
    color: rgba(var(--theme-primary), 1);
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.settings-code-input:focus {
    outline: none;
    border-color: rgba(var(--theme-primary), 0.6);
    background: rgba(31, 41, 55, 0.7);
    box-shadow: 0 0 0 3px rgba(var(--theme-primary), 0.1);
}

.settings-code-input::placeholder {
    color: #6b7280;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    letter-spacing: 0;
}

.settings-code-input.valid {
    border-color: rgba(16, 185, 129, 0.6);
    background: rgba(16, 185, 129, 0.1);
    animation: settingsCodeValid 0.5s ease;
}

.settings-code-input.invalid {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(239, 68, 68, 0.1);
    animation: settingsCodeInvalid 0.3s ease;
}

@keyframes settingsCodeValid {
    0% {
        background: rgba(16, 185, 129, 0.3);
        border-color: rgba(16, 185, 129, 0.8);
    }
    100% {
        background: rgba(16, 185, 129, 0.1);
        border-color: rgba(16, 185, 129, 0.6);
    }
}

@keyframes settingsCodeInvalid {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.copy-code-button {
    background: linear-gradient(135deg, rgba(var(--theme-primary), 0.15) 0%, rgba(var(--theme-primary-dark), 0.1) 100%);
    border: 1px solid rgba(var(--theme-primary), 0.3);
    border-radius: 8px;
    padding: 10px 20px;
    color: rgb(var(--theme-primary));
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-code-button:hover {
    background: linear-gradient(135deg, rgba(var(--theme-primary), 0.25) 0%, rgba(var(--theme-primary-dark), 0.2) 100%);
    border-color: rgba(var(--theme-primary), 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--theme-primary), 0.2);
}

.copy-code-button:active {
    transform: translateY(0);
}

.copy-code-button .button-icon {
    width: 14px;
    height: 14px;
}

.copy-code-button.copied {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.15) 100%);
    border-color: rgba(16, 185, 129, 0.5);
    color: #10b981;
}

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

.action-button {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9) 0%, rgba(17, 24, 39, 0.9) 100%);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 10px;
    padding: 12px 24px;
    color: #e0e6f0;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 
        0 2px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(255, 255, 255, 0.02);
    position: relative;
}

.action-button:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(31, 41, 55, 1) 0%, rgba(17, 24, 39, 1) 100%);
    border-color: rgba(var(--theme-primary), 0.6);
    transform: translateY(-2px);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(var(--theme-primary), 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pauseButton:not(:disabled) {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);
    border-color: rgba(239, 68, 68, 0.6);
}

#pauseButton:not(:disabled):hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);
    border-color: rgba(239, 68, 68, 0.8);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(239, 68, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

.action-button .button-icon {
    width: 16px;
    height: 16px;
}

/* Split Button */
.split-button-container {
    position: relative;
    display: flex;
}

.split-button-main {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.split-button-toggle {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 12px;
    min-width: auto;
}

.split-button-toggle .button-icon {
    width: 12px;
    height: 12px;
}

.split-button-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 10px;
    padding: 4px;
    min-width: 200px;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(var(--theme-primary), 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.split-button-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    color: #e0e6f0;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    text-align: left;
    white-space: nowrap;
}

.menu-item:hover {
    background: rgba(var(--theme-primary), 0.15);
    color: rgba(var(--theme-primary), 1);
}

.menu-icon {
    width: 16px;
    height: 16px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.98) 0%, rgba(31, 41, 55, 0.98) 100%);
    border: 1px solid rgba(75, 85, 99, 0.5);
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(var(--theme-primary), 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

.modal-close {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.modal-body pre {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e0e6f0;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.theme-label {
    padding-right: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) and (min-width: 769px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.875rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    .header-text {
        flex: 1;
    }

    .logo-image {
        width: 70px;
        height: 98px;
    }

    .card {
        padding: 24px;
    }

    .hamburger-menu {
        display: block;
    }

    .mobile-settings-panel {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        background: linear-gradient(135deg, rgba(17, 24, 39, 0.98) 0%, rgba(31, 41, 55, 0.98) 100%);
        backdrop-filter: blur(10px);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        padding: 80px 24px 24px 24px;
        transition: left 0.3s ease;
        z-index: 999;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
        border-right: 1px solid rgba(var(--theme-primary), 0.2);
        border-radius: 0;
        margin-bottom: 0;
        pointer-events: none;
    }

    .mobile-settings-panel.open {
        left: 0;
        pointer-events: auto;
    }

    .mobile-settings-panel::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: linear-gradient(to bottom, rgba(17, 24, 39, 1), transparent);
        z-index: 1;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .mobile-settings-panel.open::before {
        opacity: 1;
    }

    .input-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .input-controls {
        width: 100%;
        max-width: 100%;
        justify-content: space-between;
    }

    input[type="text"],
    input[type="number"],
    select {
        flex: 1;
    }

    .cost-amount {
        font-size: 3.5rem;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .actions {
        flex-direction: column;
    }

    .split-button-container {
        width: 100%;
    }

    .action-button {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-body pre {
        font-size: 0.8rem;
    }
    
    .settings-code-input-wrapper {
        flex-direction: column;
    }
    
    .copy-code-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    .cost-amount {
        font-size: 2.5rem;
    }

    .container {
        padding: 20px 16px;
    }
    
    .settings-code-input {
        font-size: 0.75rem;
        padding: 10px 12px;
    }
    
    .copy-code-button {
        font-size: 0.85rem;
        padding: 10px 16px;
    }
}

/* Cookie Notice Overlay */
.cookie-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.cookie-overlay.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cookie-overlay.hide {
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
}

.cookie-notice {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(17, 24, 39, 0.92) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 16px;
    padding: 24px;
    max-width: 600px;
    width: 100%;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.cookie-notice::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
}

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

.cookie-content {
    margin-bottom: 16px;
}

.cookie-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #e0e6f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.cookie-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.cookie-reject {
    background: rgba(17, 24, 39, 0.6);
    color: #9ca3af;
    border: 1px solid rgba(75, 85, 99, 0.4);
}

.cookie-reject:hover {
    background: rgba(75, 85, 99, 0.3);
    border-color: rgba(75, 85, 99, 0.6);
    color: #e0e6f0;
}

.cookie-reject:active {
    transform: scale(0.98);
}

.cookie-accept {
    background: linear-gradient(135deg, rgb(var(--theme-primary)) 0%, rgb(var(--theme-primary-dark)) 100%);
    color: #ffffff;
    box-shadow: 
        0 4px 12px rgba(var(--theme-primary), 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cookie-accept:hover {
    box-shadow: 
        0 6px 16px rgba(var(--theme-primary), 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.cookie-accept:active {
    transform: scale(0.98);
}

@media (max-width: 640px) {
    .cookie-overlay {
        padding: 12px;
    }

    .cookie-notice {
        padding: 16px;
    }

    .cookie-text {
        font-size: 13px;
    }

    .cookie-buttons {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .cookie-btn {
        width: 100%;
        padding: 12px 16px;
    }
}

/* Footer Styles */
.footer {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.4) 0%, rgba(17, 24, 39, 0.8) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(75, 85, 99, 0.3);
    padding: 60px 20px 40px;
    margin-top: 80px;
    color: #e0e6f0;
    position: relative;
    z-index: 10;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgb(var(--theme-primary)) 0%, rgb(var(--theme-primary-dark)) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-description {
    font-size: 0.95rem;
    color: #9ca3af;
    line-height: 1.6;
    margin: 0;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links li {
    margin: 0;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
}

.footer-links a:hover {
    color: rgb(var(--theme-primary));
}

.footer-links a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, rgb(var(--theme-primary)), transparent);
    transition: width 0.3s ease;
}

.footer-links a:hover::before {
    width: 100%;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 30px;
    border-top: 1px solid rgba(75, 85, 99, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    color: #9ca3af;
}

.footer-social {
    display: flex;
    gap: 16px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(75, 85, 99, 0.2);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 8px;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: rgba(var(--theme-primary), 0.15);
    border-color: rgba(var(--theme-primary), 0.5);
    color: rgb(var(--theme-primary));
    transform: translateY(-2px);
}

.social-link:active {
    transform: scale(0.95);
}

:root[data-mode="light"] .footer {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(246, 248, 252, 0.8) 100%);
    border-top: 1px solid rgba(170, 182, 198, 0.3);
}

:root[data-mode="light"] .footer-heading {
    color: #1f2937;
}

:root[data-mode="light"] .footer-description,
:root[data-mode="light"] .footer-links a,
:root[data-mode="light"] .footer-bottom p {
    color: #6b7280;
}

:root[data-mode="light"] .footer-links a:hover {
    color: rgb(var(--theme-primary));
}

:root[data-mode="light"] .footer-bottom {
    border-top: 1px solid rgba(170, 182, 198, 0.2);
}

:root[data-mode="light"] .social-link {
    background: rgba(170, 182, 198, 0.15);
    border-color: rgba(170, 182, 198, 0.3);
    color: #6b7280;
}

:root[data-mode="light"] .social-link:hover {
    background: rgba(var(--theme-primary), 0.1);
    border-color: rgba(var(--theme-primary), 0.4);
    color: rgb(var(--theme-primary));
}

@media (max-width: 960px) {
    .footer {
        padding: 40px 20px 30px;
        margin-top: 60px;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .footer {
        padding: 30px 16px 20px;
        margin-top: 50px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-title {
        font-size: 1.3rem;
    }

    .footer-section {
        align-items: center;
        text-align: center;
    }

    .footer-links {
        align-items: center;
    }
}
