/* 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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* Header Styles */
.header {
    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;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.1);
}

.brand-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c5530;
    text-decoration: none;
    transition: color 0.3s ease;
}

.brand-text:hover {
    color: #4a7c59;
}

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

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    transition: all 0.3s ease;
}

/* Main Content */
.main-content {
    margin-top: 100px;
    padding: 40px 0;
}

.page-title {
    text-align: center;
    font-size: 3rem;
    color: white;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease;
}

.page-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    animation: fadeInUp 1s ease 0.2s both;
}

/* Calculators Container */
.calculators-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.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: all 0.3s ease;
    animation: fadeInUp 1s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.calculator-title {
    text-align: center;
    color: #2c5530;
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

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

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    background: #667eea;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

/* Result Styles */
.result-container {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    border-radius: 10px;
    color: white;
    text-align: center;
    animation: slideInUp 0.5s ease;
}

.result-text {
    font-size: 1.1rem;
    font-weight: 600;
}

/* How to Use Section */
.how-to-use {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.how-to-use h2 {
    text-align: center;
    color: #2c5530;
    margin-bottom: 30px;
    font-size: 2rem;
}

.how-to-use ul {
    color: #555;
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.how-to-use li {
    margin-bottom: 0.5rem;
}

.instructions {
    display: grid;
    gap: 25px;
}

.instruction-item h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.instruction-item p {
    color: #666;
    line-height: 1.8;
}

/* Content Sections */
.content-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin: 40px auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.5s ease;
}

.content-section h2 {
    color: #2c5530;
    margin-bottom: 25px;
    font-size: 2rem;
    text-align: center;
}

.content-section h3 {
    color: #667eea;
    margin: 20px 0 10px 0;
    font-size: 1.3rem;
}

.content-text p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: #555;
}

/* Contact Form */
.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-info {
    text-align: center;
    margin-bottom: 30px;
}

.contact-info p {
    font-size: 1.1rem;
    color: #666;
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

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

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-text p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: scaleIn 0.3s ease;
}

.modal-header {
    position: absolute;
    top: 15px;
    right: 20px;
}

.close-btn {
    font-size: 30px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.countdown {
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 1.2rem;
    color: #666;
}

.result-message {
    font-size: 1.3rem;
    color: #2c5530;
    margin-bottom: 20px;
    font-weight: bold;
}

.modal-result {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    z-index: 1001;
}

.scroll-progress-bar {
    width: 100%;
    background: linear-gradient(to bottom, #667eea, #764ba2);
    transition: height 0.1s ease;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .page-title {
        font-size: 2rem;
    }

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

    .calculator-card {
        padding: 20px;
    }

    .button-group {
        flex-direction: column;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .footer-links {
        flex-direction: column;
        gap: 15px;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .how-to-use {
        padding: 30px 20px;
    }

    .content-section {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .header .container {
        padding: 1rem 15px;
    }

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

    .page-subtitle {
        font-size: 1rem;
    }

    .calculator-card {
        padding: 15px;
    }

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

    .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
        font-size: 18px;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .scroll-to-top,
    .scroll-progress,
    .modal {
        display: none !important;
    }

    body {
        background: white !important;
    }

    .calculator-card,
    .how-to-use,
    .content-section {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
}

.icon-wrapper {
  text-align: center;
  margin-bottom: 15px;
}

.ruler-icon {
  width: 120px;      /* adjust size */
  height: auto;     /* keeps aspect ratio */
}

/* About Section */
.about-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem 2rem;
    margin: 3rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: #333;
}

.about-section h2 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.about-section h3 {
    color: #667eea;
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
}

.about-section p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.about-section ul {
    color: #555;
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.about-section li {
    margin-bottom: 0.5rem;
}

