:root {
    --primary: #6c5ce7;
    --secondary: #a29bfe;
    --accent: #fd79a8;
    --dark: #2d3436;
    --light: #f5f6fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth !important;
    -webkit-tap-highlight-color: transparent;

}

body {
    background: linear-gradient(135deg, #dfe6e9, #b2bec3);
    min-height: 100vh;
    color: var(--dark);
    margin-top: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe, #6d6875);
    padding: 3rem 0;
    margin-bottom: 3rem;
    border-radius: 20px 20px 20px 20px;
    position: relative;
    overflow: hidden;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(108, 92, 231, 0.1);
    backdrop-filter: blur(20px);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    position: relative;
    z-index: 2;
    padding: 0 2rem;
}

.hero-text {
    color: white;
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.hero-languages {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 2.5rem;
    line-height: 1.5;
    white-space: pre-line;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: white;
    color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: transparent;
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Calculator Preview */
.calculator-preview {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        5px 5px 15px rgba(0, 0, 0, 0.2);
    transform:
        perspective(1000px) rotateY(-5deg) rotateX(3deg) scale(0.95);
    transform-origin: center;
    transition: transform 0.5s ease;
    will-change: transform;
}

.calculator-preview:hover {
    transform:
        perspective(1000px) rotateY(-8deg) rotateX(5deg) scale(0.98);
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    color: white;
}

.preview-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.preview-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.result-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 1rem;
}

.result-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.result-value {
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

/* Main Content */
.main-content {
    padding: 0 2rem 2rem;
}

.category-section {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background: #2d3436;
    border-radius: 3px;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.calculator-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 180px;
    text-decoration: none;
    color: inherit;
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.25);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-desc {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    font-weight: 600;
}

footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 1rem;
    opacity: 0.7;
}

footer a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 1rem;
    text-decoration: none;
}

footer a:hover {
    color: var(--primary);
}

.footer-links {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 1rem;
}

.footer-links a:hover {
    color: var(--primary);
}

.link-separator {
    color: rgba(45, 52, 54, 0.3);
    user-select: none;
}

/* Modal overlay */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 52, 54, 0.5);
    /* semi-transparent dark background */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    /* Safari support */
    z-index: 1000;
    /* Higher than header */
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.3s ease;
}

/* Modal content box */
.modal-content {
    background: rgba(15, 10, 10, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    padding: 2.5rem;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    color: var(--dark);
    position: relative;
    overflow-y: auto;
    max-height: 90vh;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.active .modal-content {
    transform: translateY(0);
}

/* Modal header */
.modal-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    color: var(--dark);
    opacity: 0.7;
    font-size: 1rem;
}

/* Modal body */
.modal-body {
    margin-bottom: 2rem;
    color: var(--light);
}

/* Modal footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Close button */
.close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    color: var(--dark);
    opacity: 0.7;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    line-height: 1;
}

.close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Modal buttons */
.modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.3);
}

.modal-btn-secondary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.modal-btn-secondary:hover {
    background: rgba(108, 92, 231, 0.1);
}

.modal a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.modal a:hover {
    color: var(--secondary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive adjustments */
/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

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

    .hero-buttons {
        justify-content: center;
    }

    .calculator-preview {
        transform: perspective(800px) rotateY(-3deg) rotateX(2deg) scale(0.9);
    }

    .calculator-preview:hover {
        transform: perspective(800px) rotateY(-5deg) rotateX(3deg) scale(0.93);
    }

    * {
        scroll-behavior: auto;
    }

    .modal {
        padding: 1rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-footer {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .modal-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .hero {
        padding: 1.5rem 0;
        border-radius: 10px;
    }

    .hero-content {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .container {
        padding: 0 1rem;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .link-separator {
        display: none;
    }

    .calculator-preview {
        transform: none;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    }

    .calculator-preview:hover {
        transform: scale(0.98);
    }

    .btn {
        padding: 0.75rem 1.5rem;
        width: 100%;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .form-input {
        padding: 0.75rem;
    }

    .modal-content {
        padding: 1.25rem;
        border-radius: 15px;
    }

    .modal-title {
        font-size: 1.3rem;
    }

    .close {
        top: 1rem;
        right: 1rem;
        width: 2rem;
        height: 2rem;
    }

    footer {
        padding: 1.5rem 1rem;
    }
}