/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #33332e;
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #667eea;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #667eea;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    padding: 40px 20px 20px;
    text-align: center;
    color: white;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Calculator Sections */
.calculator-section {
    padding: 20px 20px 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.calculator-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* Calculator Cards */
.calculator-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.calculator-card h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* Converter Inputs */
.converter-inputs {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 120px;
}

.input-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.input-group input,
.input-group select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: white;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.convert-arrow {
    font-size: 1.5rem;
    color: #667eea;
    font-weight: bold;
    margin: 0 10px;
    align-self: flex-end;
    margin-bottom: 12px;
}

/* Percentage Calculator */
.percentage-calculator {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.percentage-option h4 {
    margin-bottom: 10px;
    color: #555;
    font-size: 1.1rem;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.input-row input {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    width: 100px;
    transition: border-color 0.3s ease;
}

.input-row input:focus {
    outline: none;
    border-color: #667eea;
}

.input-row span {
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}

/* Tip Calculator */
.tip-calculator {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tip-results {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 500;
}

.result-item:last-child {
    margin-bottom: 0;
    font-size: 1.1rem;
    color: #667eea;
    border-top: 2px solid #e0e0e0;
    padding-top: 10px;
}

/* Basic Calculator */
.basic-calculator {
    max-width: 300px;
    margin: 0 auto;
}

.calculator-display {
    margin-bottom: 15px;
}

.calculator-display input {
    width: 100%;
    padding: 20px;
    font-size: 1.5rem;
    text-align: right;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #f8f9fa;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calc-btn {
    padding: 20px;
    font-size: 1.2rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.calc-btn.number {
    background: #f8f9fa;
    color: #333;
}

.calc-btn.operator {
    background: #667eea;
    color: white;
}

.calc-btn.equals {
    background: #28a745;
    color: white;
    grid-row: span 2;
}

.calc-btn.clear {
    background: #dc3545;
    color: white;
}

.calc-btn.zero {
    grid-column: span 2;
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

/* Age Calculator */
.age-calculator {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.age-results {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* Timezone Converter */
.timezone-converter {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.timezone-result {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
}

.timezone-result input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    margin-top: 5px;
}

/* Reset Button */
.reset-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.reset-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
}

.footer-content p {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 20px 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .calculator-section h2 {
        font-size: 2rem;
    }

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

    .converter-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .convert-arrow {
        align-self: center;
        margin: 10px 0;
        transform: rotate(90deg);
    }

    .input-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .input-row input {
        width: 100%;
    }

    .input-row span {
        text-align: center;
        padding: 5px 0;
    }

    .age-results {
        grid-template-columns: 1fr;
    }

    .calculator-buttons {
        gap: 8px;
    }

    .calc-btn {
        padding: 15px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .calculator-card {
        padding: 20px;
        margin: 0 10px;
    }

    .hero {
        padding: 100px 10px 60px;
    }

    .calculator-section {
        padding: 40px 10px;
    }

    .nav-container {
        padding: 0 15px;
    }

    .nav-logo {
        font-size: 1.5rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.calculator-card {
    animation: fadeInUp 0.6s ease forwards;
}

.calculator-card:nth-child(2) {
    animation-delay: 0.1s;
}

.calculator-card:nth-child(3) {
    animation-delay: 0.2s;
}

.calculator-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* Focus Styles for Accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}