/* Unit Converter Styles */
:root {
    --bg-deep: #0a1a2e;
    --bg-card: rgba(20, 40, 60, 0.8);
    --bg-input: rgba(10, 26, 46, 0.6);
    --bg-hover: rgba(59, 158, 190, 0.1);
    --text-primary: #e8f4f8;
    --text-secondary: #a8c8d8;
    --text-muted: #6a8a9a;
    --accent: #3b9ebe;
    --accent-glow: rgba(59, 158, 190, 0.3);
    --border-color: rgba(59, 158, 190, 0.2);
    --success: #4ecdc4;
    --warning: #ff6b6b;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ocean Background */
.ocean-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(180deg,
        #0a1a2e 0%,
        #0d2847 30%,
        #1a4a6e 60%,
        #0d3a5c 100%);
}

/* Bubbles Animation */
.bubbles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -20px;
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 255, 255, 0.2),
        rgba(59, 158, 190, 0.1));
    border-radius: 50%;
    animation: rise linear infinite;
    opacity: 0.6;
}

.bubble:nth-child(1) { left: 5%; width: 20px; height: 20px; animation-duration: 8s; animation-delay: 0s; }
.bubble:nth-child(2) { left: 15%; width: 15px; height: 15px; animation-duration: 10s; animation-delay: 1s; }
.bubble:nth-child(3) { left: 25%; width: 25px; height: 25px; animation-duration: 12s; animation-delay: 2s; }
.bubble:nth-child(4) { left: 35%; width: 18px; height: 18px; animation-duration: 9s; animation-delay: 0.5s; }
.bubble:nth-child(5) { left: 50%; width: 22px; height: 22px; animation-duration: 11s; animation-delay: 3s; }
.bubble:nth-child(6) { left: 60%; width: 16px; height: 16px; animation-duration: 8s; animation-delay: 2s; }
.bubble:nth-child(7) { left: 70%; width: 20px; height: 20px; animation-duration: 10s; animation-delay: 1s; }
.bubble:nth-child(8) { left: 80%; width: 24px; height: 24px; animation-duration: 13s; animation-delay: 4s; }
.bubble:nth-child(9) { left: 88%; width: 14px; height: 14px; animation-duration: 9s; animation-delay: 2.5s; }
.bubble:nth-child(10) { left: 95%; width: 18px; height: 18px; animation-duration: 11s; animation-delay: 0s; }

@keyframes rise {
    0% { transform: translateY(0) scale(1); opacity: 0.6; }
    50% { opacity: 0.4; }
    100% { transform: translateY(-100vh) scale(0.5); opacity: 0; }
}

/* Light Rays */
.light-rays {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(180deg, rgba(125, 211, 252, 0.05) 0%, transparent 40%),
        radial-gradient(ellipse at 30% 0%, rgba(59, 158, 190, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 0%, rgba(59, 158, 190, 0.06) 0%, transparent 50%);
    animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sound Toggle */
.sound-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100;
}

.sound-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.sound-toggle.sound-on {
    color: var(--accent);
    border-color: var(--accent);
}

.sound-toggle svg {
    width: 20px;
    height: 20px;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--accent);
}

.back-link svg {
    width: 16px;
    height: 16px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Main */
main {
    flex: 1;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.category-tab {
    flex: 1;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-tab svg {
    width: 20px;
    height: 20px;
}

.category-tab:hover {
    border-color: var(--accent);
    color: var(--text-secondary);
}

.category-tab.active {
    background: rgba(59, 158, 190, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

/* Converter Section */
.converter-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.convert-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.input-group {
    flex: 1;
}

.input-group input {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group input[readonly] {
    background: rgba(59, 158, 190, 0.1);
    cursor: default;
}

.select-group {
    min-width: 140px;
}

.select-group select {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-group select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Swap Button */
.swap-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin: 0 auto 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.swap-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: rotate(180deg);
}

.swap-btn svg {
    width: 24px;
    height: 24px;
}

/* Copy Button */
.copy-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.copy-btn svg {
    width: 18px;
    height: 18px;
}

/* Common Section */
.common-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.common-section h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-align: center;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.quick-item {
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.quick-item .value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    display: block;
    margin-bottom: 4px;
}

/* Status Message */
.status-message {
    text-align: center;
    font-size: 0.9rem;
    min-height: 24px;
    color: var(--text-muted);
}

.status-message.success {
    color: var(--success);
}

.status-message.error {
    color: var(--warning);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

footer .version {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .category-tabs {
        gap: 6px;
    }

    .category-tab {
        padding: 10px 6px;
        font-size: 0.7rem;
        min-width: 60px;
    }

    .category-tab svg {
        width: 18px;
        height: 18px;
    }

    .convert-row {
        flex-direction: column;
    }

    .select-group {
        min-width: 100%;
    }

    .quick-grid {
        grid-template-columns: 1fr;
    }
}
