:root {
    --bg-color: #0d1117;
    --glass-bg: rgba(22, 27, 34, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-color: #58a6ff;
    --success-color: #238636;
    --danger-color: #da3633;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --input-bg: rgba(13, 17, 23, 0.8);
    --card-bg: rgba(48, 54, 61, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Vazirmatn', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 20px;
}

/* Background Animation */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite ease-in-out;
}

.globe-1 {
    width: 300px;
    height: 300px;
    background: #58a6ff;
    top: -50px;
    left: -50px;
    animation-delay: 0s;
}

.globe-2 {
    width: 400px;
    height: 400px;
    background: #8957e5;
    bottom: -100px;
    right: -100px;
    animation-delay: -3s;
}

.globe-3 {
    width: 200px;
    height: 200px;
    background: #238636;
    top: 40%;
    left: 40%;
    animation-delay: -6s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, -20px);
    }
}

/* Main Container */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    width: 100%;
    max-width: 600px;
    /* Mobile friendly max width */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #58a6ff, #8957e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Input Section */
.input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.input-group input {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

/* Full width for the first input if needed, or keeping grid */
.input-group:nth-child(1) {
    grid-column: span 2;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.stat-card.highlight {
    background: rgba(35, 134, 54, 0.1);
    border-color: rgba(35, 134, 54, 0.3);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

#dispNetProfit.positive {
    color: var(--success-color);
}

#dispNetProfit.negative {
    color: var(--danger-color);
}

#dispGrowth.positive {
    color: var(--success-color);
}

#dispGrowth.negative {
    color: var(--danger-color);
}

/* Table Section */
.table-container h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    padding: 12px 16px;
    text-align: right;
    border-bottom: 1px solid var(--glass-border);
}

th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

td {
    color: var(--text-primary);
    font-feature-settings: "tnum";
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .glass-container {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .input-section {
        grid-template-columns: 1fr;
    }

    .input-group:nth-child(1) {
        grid-column: span 1;
    }

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

/* Table Input Styling */
.table-input {
    background: rgba(13, 17, 23, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 6px 8px;
    color: var(--text-primary);
    width: 80px;
    text-align: right;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
}

.table-input:focus {
    background: rgba(13, 17, 23, 0.9);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.text-secondary {
    color: var(--text-secondary);
}

/* Update Input Group for Disabled derived input */
input:disabled {
    background: rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
    border-color: transparent;
}

/* Remove Spinners from Number Inputs */
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
}
