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

:root {
    --bg-dark: #0a0e1a;
    --bg-card: #151b2e;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #1e293b;
    --success: #10b981;
    --warning: #f59e0b;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--accent);
}

.version {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Dashboard */
.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero-section {
    margin-bottom: 3rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Input */
.calc-input label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper {
    position: relative;
    max-width: 400px;
}

.currency {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Platforms Grid */
.platforms-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Platform Box */
.platform-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
    position: relative;
}

.platform-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 12px 12px 0 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.platform-box:hover::before {
    opacity: 1;
}

.platform-box:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Header */
.box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.platform-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon {
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon svg {
    display: block;
}

.platform-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.info-trigger {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.info-trigger:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-1px);
}

/* Config Area */
.config-area {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.switch-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0;
}

.switch-item input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.switch-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.radio-group input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.radio-group span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.select-minimal {
    padding: 0.5rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    font-family: inherit;
}

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

/* Metrics */
.metrics {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.metric-label small {
    font-size: 0.75rem;
    color: var(--accent);
    margin-left: 0.25rem;
}

.metric-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.metric-total {
    display: flex;
    justify-content: space-between;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-weight: 600;
    color: var(--warning);
}

/* Result Bar */
.result-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    margin-top: 1rem;
}

.result-bar.negative {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border-color: rgba(239, 68, 68, 0.2);
}

.result-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.result-amount {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--success);
    letter-spacing: -0.02em;
}

.result-bar.negative .result-amount {
    color: #ef4444;
}

/* Platform Note */
.platform-note {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 6px;
    text-align: center;
}

.platform-note small {
    font-size: 0.75rem;
    color: #fbbf24;
    font-weight: 500;
}

/* Footer */
.data-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

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

.modal-content {
    padding: 2.5rem;
}

.modal-content h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent);
}

.modal-content h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.modal-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

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

.modal-content li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.modal-content li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

/* Scrollbar */
.modal-box::-webkit-scrollbar {
    width: 8px;
}

.modal-box::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

.modal-box::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

/* Responsive - Mobile First */
@media (max-width: 1024px) {
    .platforms-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .dashboard {
        padding: 1.5rem 1rem;
    }

    .hero-section {
        margin-bottom: 2rem;
    }

    .hero-section h1 {
        font-size: 1.85rem;
        line-height: 1.2;
    }

    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .platforms-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .top-bar {
        padding: 1rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .version {
        font-size: 0.7rem;
    }

    .input-wrapper {
        max-width: 100%;
    }

    .input-wrapper input {
        font-size: 1.35rem;
        padding: 0.9rem 1rem 0.9rem 3.25rem;
    }

    .currency {
        font-size: 1.1rem;
        left: 1rem;
    }

    .platform-box {
        padding: 1.25rem;
    }

    .box-header {
        margin-bottom: 1rem;
    }

    .icon {
        font-size: 1.5rem;
    }

    .platform-info h3 {
        font-size: 1rem;
    }

    .info-trigger {
        padding: 0.35rem 0.65rem;
        font-size: 0.7rem;
    }

    .config-area {
        gap: 0.6rem;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .radio-group {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .metric {
        font-size: 0.9rem;
    }

    .metric-label {
        font-size: 0.825rem;
    }

    .metric-value {
        font-size: 0.9rem;
    }

    .result-bar {
        padding: 0.9rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .result-label {
        font-size: 0.825rem;
    }

    .result-amount {
        font-size: 1.5rem;
        align-self: flex-end;
    }

    .modal-box {
        width: 95%;
        max-height: 90vh;
    }

    .modal-content {
        padding: 2rem 1.25rem;
    }

    .modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .modal-content h3 {
        font-size: 1.1rem;
        margin-top: 1.25rem;
    }

    .data-info {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1.25rem;
        font-size: 0.8rem;
    }

    .data-info span:nth-child(2) {
        display: none;
    }

    /* SEO Section Mobile */
    .seo-content {
        margin-top: 2rem !important;
        padding: 1.5rem !important;
    }

    .seo-content h2 {
        font-size: 1.35rem !important;
    }

    .seo-content h3 {
        font-size: 1.1rem !important;
    }

    .seo-content p,
    .seo-content li {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 480px) {
    .dashboard {
        padding: 1rem 0.75rem;
    }

    .hero-section h1 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .top-bar {
        padding: 0.85rem;
    }

    .logo {
        font-size: 1rem;
    }

    .input-wrapper input {
        font-size: 1.2rem;
        padding: 0.85rem 0.85rem 0.85rem 3rem;
    }

    .currency {
        font-size: 1rem;
        left: 0.85rem;
    }

    .platform-box {
        padding: 1rem;
    }

    .icon {
        font-size: 1.35rem;
    }

    .platform-info h3 {
        font-size: 0.95rem;
    }

    .info-trigger {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
    }

    .config-area {
        gap: 0.5rem;
    }

    .switch-item {
        padding: 0.4rem 0;
    }

    .switch-label,
    .radio-group span {
        font-size: 0.8rem;
    }

    .select-minimal {
        padding: 0.45rem 0.65rem;
        font-size: 0.8rem;
    }

    .metric-label {
        font-size: 0.8rem;
    }

    .metric-value {
        font-size: 0.85rem;
    }

    .result-bar {
        padding: 0.8rem 0.9rem;
    }

    .result-amount {
        font-size: 1.35rem;
    }

    .modal-close {
        width: 28px;
        height: 28px;
        font-size: 1.3rem;
        top: 0.75rem;
        right: 0.75rem;
    }

    .modal-content {
        padding: 1.75rem 1rem;
    }

    .modal-content h2 {
        font-size: 1.35rem;
    }

    .modal-content h3 {
        font-size: 1rem;
    }

    .modal-content p,
    .modal-content li {
        font-size: 0.875rem;
    }

    /* SEO Section Mobile Small */
    .seo-content {
        margin-top: 1.5rem !important;
        padding: 1.25rem !important;
        border-radius: 8px !important;
    }

    .seo-content h2 {
        font-size: 1.2rem !important;
        margin-bottom: 0.85rem !important;
    }

    .seo-content h3 {
        font-size: 1rem !important;
        margin-top: 1rem !important;
        margin-bottom: 0.6rem !important;
    }

    .seo-content p,
    .seo-content li {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }

    .seo-content ul {
        padding-left: 1.25rem !important;
    }
}

@media (max-width: 360px) {
    .hero-section h1 {
        font-size: 1.45rem;
    }

    .input-wrapper input {
        font-size: 1.1rem;
    }

    .result-amount {
        font-size: 1.2rem;
    }

    .platform-info h3 {
        font-size: 0.9rem;
    }

    .info-trigger {
        font-size: 0.6rem;
        padding: 0.25rem 0.45rem;
    }
}

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
    .info-trigger,
    .switch-item,
    .radio-group label,
    .select-minimal,
    .modal-close {
        min-height: 44px;
        min-width: 44px;
    }

    .info-trigger {
        padding: 0.5rem 0.85rem;
    }

    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
    }
}
