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

:root {
    --bg-primary: #0A0E27;
    --bg-secondary: #151A3A;
    --bg-card: #1A1F3A;
    --bg-card-secondary: #242B47;
    --text-primary: #FFFFFF;
    --text-secondary: #8892B0;
    --border-color: #2A3155;
    --border-light: #3A4166;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-dark: rgba(0, 0, 0, 0.5);
    --accent-green: #00D9FF;
    --accent-yellow: #FFE500;
    --accent-red: #FF006E;
    --accent-purple: #8B5CF6;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #00D9FF 0%, #8B5CF6 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100); /* Dynamic viewport height for mobile */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 217, 255, 0.3) 0%, transparent 50%);
    overflow: hidden;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Light Mode */
body.light-mode {
    --bg-primary: #FFFFFF;
    --bg-secondary: #FAFBFC;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-secondary: rgba(250, 251, 252, 0.95);
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;
    --shadow: rgba(0, 0, 0, 0.04);
    --shadow-dark: rgba(0, 0, 0, 0.08);
    --accent-green: #10B981;
    --accent-yellow: #F59E0B;
    --accent-red: #EF4444;
    --accent-purple: #8B5CF6;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
}

body.light-mode .main-content,
body.light-mode .header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

body.light-mode .premium-card,
body.light-mode .price-card {
    background: rgba(250, 251, 252, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 231, 235, 0.6);
}

body.light-mode .price-card {
    background-image: linear-gradient(rgba(250, 251, 252, 0.95), rgba(250, 251, 252, 0.95)),
                      linear-gradient(135deg, var(--accent-green) 0%, var(--accent-purple) 100%);
}

body.light-mode .gauge-background {
    opacity: 0.9;
}

body.light-mode .psi-gauge {
    background: rgba(243, 244, 246, 1);
    border: 2px solid rgba(229, 231, 235, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

body.light-mode .psi-value {
    background: linear-gradient(135deg, #8B5CF6 0%, #10B981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-mode .logo-text {
    background: linear-gradient(135deg, #8B5CF6 0%, #10B981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-mode .last-update span,
body.light-mode .exchange-rate span {
    color: var(--accent-green);
}

body.light-mode .update-info {
    border-top: 1px solid rgba(229, 231, 235, 0.6);
}

body.light-mode .toggle-btn {
    background: rgba(243, 244, 246, 0.8);
    border: 1px solid rgba(229, 231, 235, 0.8);
    color: var(--text-secondary);
}

body.light-mode .toggle-btn.active {
    background: linear-gradient(135deg, #10B981 0%, #8B5CF6 100%);
    color: white;
    border-color: transparent;
}

body.light-mode .icon-btn {
    background: rgba(243, 244, 246, 0.8);
    border: 1px solid rgba(229, 231, 235, 0.8);
    color: var(--text-secondary);
}

body.light-mode .gauge-pointer {
    background: #0F172A;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.container {
    width: 100%;
    max-width: 900px;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100); /* Dynamic viewport height for mobile */
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

/* Header Styles */
.header {
    background: rgba(26, 31, 58, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 15px 25px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 10px 30px var(--shadow);
    flex-shrink: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
}

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

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 217, 255, 0.3));
}

.logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Crypto Toggle */
.crypto-toggle {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
}

.toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px var(--shadow-dark);
}

.toggle-btn.active {
    background: var(--gradient-secondary);
    color: white;
    border-color: transparent;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.4);
    font-weight: 600;
}

.toggle-btn .icon {
    font-size: 20px;
}

/* Icon Buttons */
.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-dark);
}


/* Main Content */
.main-content {
    background: rgba(26, 31, 58, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 25px;
    box-shadow: 0 10px 30px var(--shadow);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* PSI Container */
.psi-container {
    text-align: center;
    margin-bottom: 25px;
    flex-shrink: 0;
}

.psi-container h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.psi-gauge-wrapper {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.psi-gauge {
    width: 100%;
    height: 50px;
    position: relative;
    background: rgba(36, 43, 71, 0.8);
    border-radius: 25px;
    overflow: hidden;
    border: 2px solid var(--border-light);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.gauge-background {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, 
        var(--accent-green) 0%, 
        #4ADE80 20%, 
        var(--accent-yellow) 40%, 
        #FFA500 60%, 
        #FF6B6B 80%, 
        var(--accent-red) 100%);
    opacity: 0.9;
}

.gauge-pointer {
    position: absolute;
    top: -5px;
    width: 6px;
    height: 60px;
    background: white;
    left: 50%;
    transform: translateX(-50%);
    transition: left 1s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.gauge-pointer::after {
    content: '▼';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
}

.psi-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 48px;
    font-weight: 700;
    margin: 20px 0 10px;
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.psi-labels {
    display: flex;
    justify-content: space-between;
    max-width: 400px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.label-fear { color: var(--accent-green); }
.label-neutral { color: #FFC107; }
.label-greed { color: var(--accent-red); }

/* Premium Cards */
.premium-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.premium-card {
    background: rgba(36, 43, 71, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.premium-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
}

.premium-card h3 {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.premium-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Price Grid */
.price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

/* Prevent text selection on buttons for better mobile UX */
.toggle-btn,
.icon-btn,
button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.price-card {
    background: rgba(36, 43, 71, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    border: 1px solid transparent;
    background-image: linear-gradient(rgba(36, 43, 71, 0.6), rgba(36, 43, 71, 0.6)),
                      linear-gradient(135deg, var(--accent-green) 0%, var(--accent-purple) 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    transition: all 0.3s ease;
}

.price-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 217, 255, 0.2);
}

.price-icon {
    font-size: 48px;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.price-card h4 {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crypto-label {
    color: var(--accent-purple);
    font-weight: 700;
}

.price {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.price-krw {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
    opacity: 0.8;
}

/* Update Info */
.update-info {
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--text-secondary);
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

.update-info div {
    margin: 5px 0;
}

.last-update span, .exchange-rate span {
    font-weight: 600;
    color: var(--accent-green);
}

/* Loading State */
.loading {
    opacity: 0.6;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(26, 31, 58, 0.95);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 25px;
        width: 95%;
        max-height: 85vh;
        margin: 10px;
        border-radius: 20px;
    }
    
    .modal-close {
        top: 10px;
        right: 15px;
        font-size: 24px;
    }
    
    .formula-container {
        padding: 15px;
        margin: 15px 0;
        border-radius: 16px;
    }
    
    .formula-code {
        font-size: 14px;
        padding: 15px;
        border-radius: 8px;
        overflow-x: auto;
    }
    
    .formula-variables {
        gap: 15px;
    }
    
    .variable {
        padding: 15px;
        border-radius: 10px;
    }
    
    .var-name {
        font-size: 16px;
    }
    
    .var-desc {
        font-size: 12px;
    }
    
    .var-info {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 20px;
        width: calc(100% - 20px);
        max-height: 90vh;
    }
    
    .modal-content h2 {
        font-size: 20px;
    }
    
    .modal-content h3 {
        font-size: 16px;
        margin-top: 20px;
        margin-bottom: 12px;
    }
    
    .modal-content p {
        font-size: 13px;
    }
    
    .formula-code {
        font-size: 12px;
        padding: 12px;
    }
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.modal-content h3 {
    margin-top: 25px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.modal-content ul {
    list-style: none;
    padding-left: 0;
}

.modal-content li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    color: var(--text-secondary);
}

.modal-content li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-primary);
}

.color-indicators li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.indicator-green {
    color: var(--accent-green);
    font-size: 24px;
    filter: drop-shadow(0 0 8px currentColor);
}

.indicator-yellow {
    color: var(--accent-yellow);
    font-size: 24px;
    filter: drop-shadow(0 0 8px currentColor);
}

.indicator-red {
    color: var(--accent-red);
    font-size: 24px;
    filter: drop-shadow(0 0 8px currentColor);
}

.footer-text {
    margin-top: 30px;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* Formula Container - Enhanced Design */
.formula-container {
    background: rgba(36, 43, 71, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.formula-main {
    text-align: center;
    margin-bottom: 20px;
}

.formula-title {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.formula-code {
    display: block;
    font-size: 18px;
    color: var(--accent-green);
    font-weight: 600;
    font-family: 'Space Grotesk', monospace;
    padding: 20px;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 12px;
}

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

.variable {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
}

.variable:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

.var-name {
    display: block;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: bold;
    margin-bottom: 5px;
}

.var-desc {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    font-family: monospace;
    margin-bottom: 5px;
}

.var-info {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
}

.formula-note {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
}

/* FAQ Section */
.faq-section {
    margin-top: 40px;
    padding: 30px;
    background: var(--bg-card-secondary);
    border-radius: 15px;
}

.faq-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.faq-item {
    margin-bottom: 15px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item[open] {
    box-shadow: 0 3px 10px var(--shadow);
}

.faq-item summary {
    padding: 15px 20px;
    background: var(--bg-card);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    list-style: none;
    position: relative;
    padding-right: 40px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--text-primary);
    transition: transform 0.3s ease;
}

.faq-item[open] summary::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-content {
    padding: 20px;
    background: var(--bg-card);
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-content ul {
    margin-top: 10px;
    padding-left: 20px;
}

.faq-content li {
    margin-bottom: 5px;
}

/* Widget Section */
.widget-section {
    margin-top: 30px;
    padding: 25px;
    background: var(--bg-card);
    border-radius: 15px;
    border: 2px dashed var(--border-light);
    text-align: center;
}

.widget-section h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.widget-section p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.embed-code {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card-secondary);
    padding: 15px;
    border-radius: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.embed-code code {
    flex: 1;
    font-family: monospace;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow-x: auto;
}

.copy-btn {
    background: var(--text-primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
        overflow-x: hidden;
    }
    
    .container {
        padding: 10px;
        height: 100vh;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .header {
        padding: 12px 15px;
        margin-bottom: 15px;
        border-radius: 16px;
    }
    
    .header-content {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        justify-content: space-between;
        align-items: center;
    }
    
    .logo-container {
        flex: 0 0 auto;
        gap: 8px;
        min-width: 0;
    }
    
    .logo {
        height: 30px;
        width: auto;
    }
    
    .logo-text {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    
    .header-controls {
        flex: 1 1 auto;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .crypto-toggle {
        display: flex;
        gap: 5px;
    }
    
    .toggle-btn {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 8px;
    }
    
    .toggle-btn .icon {
        font-size: 16px;
    }
    
    .icon-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
        border-radius: 8px;
    }
    
    .main-content {
        padding: 15px;
        border-radius: 20px;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .psi-container h2 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .psi-gauge {
        height: 40px;
        border-radius: 20px;
    }
    
    .gauge-pointer {
        width: 4px;
        height: 48px;
        top: -4px;
    }
    
    .psi-value {
        font-size: 32px;
        margin: 15px 0 8px;
    }
    
    .psi-labels {
        font-size: 12px;
    }
    
    .premium-cards {
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .premium-card {
        padding: 15px;
        border-radius: 16px;
    }
    
    .premium-card h3 {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .premium-value {
        font-size: 24px;
    }
    
    .price-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .price-card {
        padding: 15px;
        border-radius: 16px;
    }
    
    .price-icon {
        font-size: 36px;
        margin-bottom: 10px;
    }
    
    .price-card h4 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .price {
        font-size: 22px;
    }
    
    .price-krw {
        font-size: 12px;
        margin-top: 5px;
    }
    
    .update-info {
        font-size: 11px;
        padding-top: 15px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .header {
        padding: 10px 12px;
    }
    
    .logo {
        height: 28px;
    }
    
    .logo-text {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100px;
    }
    
    .toggle-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .toggle-btn .icon {
        font-size: 14px;
    }
    
    .icon-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .psi-container h2 {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .psi-value {
        font-size: 28px;
    }
    
    .premium-value {
        font-size: 20px;
    }
    
    .price {
        font-size: 20px;
    }
}

/* Very small devices - landscape mode */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        padding: 5px;
    }
    
    .header {
        padding: 8px 12px;
        margin-bottom: 10px;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .psi-gauge {
        height: 35px;
    }
    
    .psi-value {
        font-size: 24px;
        margin: 10px 0 5px;
    }
    
    .premium-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .price-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .price-icon {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .price {
        font-size: 18px;
    }
}

/* Animation keyframes */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

.loading .price,
.loading .premium-value,
.loading .psi-value {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Light mode additions */
body.light-mode .modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
}

body.light-mode .formula-container,
body.light-mode .variable {
    background: rgba(248, 249, 250, 0.9);
    border-color: var(--border-color);
}

body.light-mode .formula-code {
    background: rgba(124, 77, 255, 0.1);
    border-color: rgba(124, 77, 255, 0.3);
    color: var(--accent-purple);
}