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

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: transparent;
    min-height: 100vh;
    color: #ffffff;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.iframe-mode .container {
    padding: 10px;
}

.iframe-mode .calculator-card {
    padding: 20px;
    margin-bottom: 0;
}

.iframe-mode .form {
    padding: 15px;
    gap: 15px;
}

.calculator-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 20px;
    box-shadow: none;
    padding: 40px;
    margin: 0 auto;
    width: 100%;
    max-width: 1000px;
    position: relative;
    overflow: hidden;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.1) 0%, rgba(138, 43, 226, 0.1) 100%);
    border-radius: 20px;
    z-index: -1;
}

.form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, transparent, rgba(0, 191, 255, 0.05));
    border-radius: 20px;
    z-index: -1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.form-group::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(145deg, transparent, rgba(0, 191, 255, 0.1));
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.form-group:hover::before {
    opacity: 1;
}

.form-label {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-label i {
    color: #00BFFF;
    width: 18px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.form-group:hover .form-label i {
    color: #8A2BE2;
    transform: scale(1.1);
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.form-select {
    width: 100%;
    padding: 16px 50px 16px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #ffffff;
}

.form-select:focus {
    outline: none;
    border-color: #00BFFF;
    box-shadow: 0 0 0 4px rgba(0, 191, 255, 0.2), 0 4px 16px rgba(0, 191, 255, 0.3);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

.form-select:hover:not(:disabled) {
    border-color: rgba(0, 191, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 191, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

.form-select:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-select option {
    padding: 12px 16px;
    font-weight: 500;
    color: #ffffff;
    background: #1a1a2e;
}

.form-select option:hover {
    background: #16213e;
}

.select-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.8rem;
}

.select-wrapper:hover .select-icon {
    color: #00BFFF;
    transform: translateY(-50%) scale(1.1);
}

.form-select:focus + .select-icon {
    transform: translateY(-50%) rotate(180deg) scale(1.1);
    color: #00BFFF;
}

.form-select:not(:disabled):hover + .select-icon {
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(-50%) scale(1);
    }
    40% {
        transform: translateY(-50%) scale(1.2);
    }
    60% {
        transform: translateY(-50%) scale(1.1);
    }
}

.btn-calculate {
    background: linear-gradient(135deg, #00BFFF 0%, #8A2BE2 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 191, 255, 0.3);
    grid-column: 1 / -1;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
}

.btn-calculate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.btn-calculate:hover::before {
    left: 100%;
}

.btn-calculate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 191, 255, 0.4);
}

.btn-calculate:active:not(:disabled) {
    transform: translateY(0);
}

.btn-calculate:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-calculate i {
    font-size: 1.2rem;
    position: relative;
    z-index: 2;
}

.btn-calculate span {
    position: relative;
    z-index: 2;
}

.results {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 191, 255, 0.05) 0%, rgba(138, 43, 226, 0.05) 100%);
    border-radius: 16px;
    z-index: -1;
}

.results.hidden {
    display: none;
}

.results h3 {
    color: #ffffff;
    margin-bottom: 25px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results h3 i {
    color: #00BFFF;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.result-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    border-left: 4px solid;
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    border-radius: 12px;
    z-index: -1;
}

.result-card:hover {
    transform: translateY(-2px);
}

.result-card.original {
    border-left-color: #00BFFF;
}

.result-card.stage1 {
    border-left-color: #8A2BE2;
}

.result-card.gains {
    border-left-color: #00ff88;
}

.result-card h4 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.metric:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.metric-label {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.metric-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: #ffffff;
}

.metric-value.gain {
    color: #00ff88;
}

.metric-unit {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-left: 5px;
}

.loading {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 191, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
    border-radius: 14px;
}

.loading .select-icon {
    animation: spin 1s linear infinite;
    color: #00BFFF;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

@media (max-width: 1024px) {
    .form {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .calculator-card {
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .calculator-card {
        padding: 25px;
        max-width: 98%;
    }
    
    .form {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-calculate {
        padding: 15px 30px;
        font-size: 1rem;
    }
    
    .iframe-mode .container {
        padding: 5px;
    }
    
    .iframe-mode .calculator-card {
        padding: 15px;
        max-width: 98%;
    }
    
    .iframe-mode .form {
        padding: 10px;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .calculator-card {
        padding: 20px;
        max-width: 98%;
    }
    
    .form-select {
        padding: 12px 40px 12px 15px;
    }
    
    .select-icon {
        right: 15px;
    }
}

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

.results:not(.hidden) {
    animation: fadeInUp 0.6s ease-out;
}

.form-select::-webkit-scrollbar {
    width: 6px;
}

.form-select::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.form-select::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, rgba(0, 191, 255, 0.5), rgba(138, 43, 226, 0.5));
    border-radius: 3px;
    transition: background 0.3s ease;
}

.form-select::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, rgba(0, 191, 255, 0.7), rgba(138, 43, 226, 0.7));
}

.form-group:focus-within .form-label {
    color: #00BFFF;
}

.form-group:focus-within .form-label i {
    color: #8A2BE2;
    transform: scale(1.15);
}

