:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary-color: #007AFF;
    --accent-cyan: #00f2ff;
    --success-green: #00ff88;
    --danger-red: #ff4d4d;
    --warning-orange: #ffcc00;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.bg-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 20% 30%, #1e3a8a 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, #1e1e2e 0%, transparent 40%);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 480px;
    height: 100%;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
}

header {
    margin-bottom: 24px;
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.icon-btn {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s ease;
}

.icon-btn:hover {
    color: var(--primary-color);
}

.subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Tabs */
.tabs {
    display: flex;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    border: none;
    background: none;
    color: var(--text-secondary);
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* Content Area */
.content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Styles */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    margin-left: 4px;
}

.input-group input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    color: white;
    font-size: 18px;
    font-family: "SF Mono", "Roboto Mono", monospace;
    backdrop-filter: blur(5px);
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}

/* Results Card */
.results-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    margin-top: 24px;
    backdrop-filter: blur(10px);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-item span:first-child {
    font-size: 14px;
    color: var(--text-secondary);
}

.result-item span:last-child {
    font-size: 18px;
    font-weight: 600;
}

.result-item.principal {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--border-color);
}

.result-item.principal span:last-child {
    font-size: 24px;
}

.highlight-green {
    color: var(--success-green);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.highlight-orange {
    color: var(--warning-orange);
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

.highlight-red {
    color: var(--danger-red);
    text-shadow: 0 0 10px rgba(255, 77, 77, 0.3);
}

.suggestion-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-align: center;
    font-style: italic;
}

.note {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 12px;
    text-align: center;
}

/* Footer Controls */
.controls {
    padding-top: 16px;
}

.secondary-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.98);
}

.primary-btn {
    width: 100%;
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    backdrop-filter: blur(8px);
}

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

.modal-content {
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    padding: 24px;
    border-radius: 24px;
    overflow-y: auto;
}

.glass {
    background: rgba(25, 30, 45, 0.95);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
    color: var(--accent-cyan);
}

.modal-body section {
    margin-bottom: 20px;
}

.modal-body h3 {
    font-size: 15px;
    margin-bottom: 10px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body ul {
    list-style: none;
    font-size: 14px;
}

.modal-body li {
    margin-bottom: 8px;
    padding-left: 14px;
    position: relative;
    color: var(--text-secondary);
}

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

.modal-body p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.5;
}

.tips {
    background: rgba(0, 122, 255, 0.1);
    padding: 12px;
    border-radius: 12px;
    border-left: 3px solid var(--primary-color);
}

/* Hide arrow for number input */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}