:root {
    --surface: #ffffff;
    --surface-muted: #f4f6fb;
    --border: #e3e8f2;
    --text-main: #1c2333;
    --text-muted: #5f6b85;
    --primary: #4f46ef;
    --primary-dark: #312e81;
    --primary-light: #6366f1;
    --accent: #36cfc9;
    --success: #10b981;
    --info: #3b82f6;
    --danger: #ef4444;
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
    --shadow-medium: 0 10px 25px rgba(15, 23, 42, 0.1);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tool Wrapper */
.range-generator-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 40px;
}

/* Tool Cards */
.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 32px;
    transition: var(--transition);
}

.tool-card:hover {
    box-shadow: var(--shadow-medium);
}

.card-header {
    margin-bottom: 24px;
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px 0;
}

.card-description {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

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

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-label i {
    font-size: 12px;
    color: var(--primary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-main);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 239, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
}

/* Options Group */
.options-group {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--surface-muted);
    border-radius: var(--radius);
    border: 2px solid var(--border);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-custom {
    position: relative;
    display: inline-block;
    width: 22px;
    height: 22px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 6px;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-input:checked ~ .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-input:checked ~ .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-input:focus ~ .checkbox-custom {
    box-shadow: 0 0 0 3px rgba(79, 70, 239, 0.1);
}

.checkbox-text {
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.5;
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 239, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 239, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--surface-muted);
    color: var(--text-main);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

/* Results Card */
.results-card {
    margin-top: 24px;
    animation: slideIn 0.4s ease-out;
}

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

.results-display {
    margin-bottom: 24px;
}

.numbers-output {
    background: var(--surface-muted);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    min-height: 80px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
}

.number-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(79, 70, 239, 0.2);
}

.number-item:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(79, 70, 239, 0.3);
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.stat-card {
    background: var(--surface-muted);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: var(--radius);
    font-size: 20px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    word-break: break-word;
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .tool-card {
        padding: 24px 20px;
    }

    .card-title {
        font-size: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .options-group {
        padding: 16px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .stat-value {
        font-size: 18px;
    }

    .numbers-output {
        padding: 16px;
        gap: 8px;
    }

    .number-item {
        font-size: 14px;
        padding: 8px 14px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .number-item {
        font-size: 13px;
        padding: 7px 12px;
    }
}
