/* BlueTools CSS - Blue Theme */
:root {
    --primary-blue: #2563eb;
    --secondary-blue: #1e40af;
    --light-blue: #3b82f6;
    --very-light-blue: #eff6ff;
    --dark-blue: #1e3a8a;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --white: #ffffff;
    --light-gray: #f8fafc;
    --border-color: #e5e7eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

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

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: var(--white);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.2);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

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

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--white);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Mobile Sidebar Menu */
.main-nav {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-blue);
    transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: var(--white);
    padding: 150px 0 100px;
    text-align: center;
    margin-top: 80px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--white), #bfdbfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

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

/* Section Styles */
section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    border-radius: 2px;
}

/* Tools Section */
.tools-section {
    background-color: var(--light-gray);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tool-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.15);
    border-color: var(--primary-blue);
}

.tool-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.tool-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.tool-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border: 2px solid var(--primary-blue);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.tool-link:hover {
    background-color: var(--primary-blue);
    color: var(--white);
}

/* About Section */
.about-section {
    background-color: var(--white);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.feature-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature h4 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.feature p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Contact Section */
.contact-section {
    background: linear-gradient(135deg, var(--very-light-blue) 0%, var(--light-gray) 100%);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info h3,
.contact-form h3 {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.contact-icon {
    font-size: 1.5rem;
    color: var(--primary-blue);
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: var(--white);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Footer */
.main-footer {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--secondary-blue) 100%);
    color: var(--white);
    padding: 0.5rem 0;   /* ✅ just a little vertical padding */
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--white);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

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

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

.footer-section ul li a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: none;    /* remove border if you don't want extra spacing */
    padding-top: 0;      /* remove extra top padding */
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;   /* slightly smaller text */
    line-height: 1.4;    /* tighter vertical alignment */
}

/* GPA Calculator Specific Styles */
.gpa-calculator-body {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    min-height: 100vh;
}

/* Main Content for GPA Calculator */
.main-content {
    padding: 120px 0 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.calculator-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    width: 100%;
    border: 1px solid var(--border-color);
}

.calculator-container h1 {
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 2rem;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.input-group select,
.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--white);
}

.input-group select:focus,
.input-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.calculate-btn {
    width: 200px;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.result-container {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--success) 0%, #38ef7d 100%);
    border-radius: 12px;
    text-align: center;
    display: none;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.result-container.show {
    display: block;
    animation: slideIn 0.5s ease;
}

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

.result-item {
    margin-bottom: 1rem;
}

.result-label {
    color: var(--white);
    font-weight: 600;
    font-size: 1rem;
}

.result-value {
    color: var(--white);
    font-size: 1.8rem;
    font-weight: bold;
}

.grade-scale {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--very-light-blue);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.grade-scale h3 {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
}

.grade-scale table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.grade-scale th,
.grade-scale td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.grade-scale th {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    color: var(--white);
    font-weight: 600;
}

.grade-scale tr:last-child td {
    border-bottom: none;
}

/* Total GPA Section Styles */
.total-gpa-section {
    display: none;
    margin-top: 2rem;
    padding: 2rem;
    background: var(--very-light-blue);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.total-gpa-section h2 {
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.subjects-list {
    margin-bottom: 2rem;
}

.subject-row {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    background: var(--white);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.subject-row label {
    min-width: 200px;
    margin-bottom: 0;
    color: var(--text-dark);
    font-weight: 600;
}

.gpa-select {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--white);
}

.gpa-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.total-gpa-result {
    display: none;
    padding: 2rem;
    background: linear-gradient(135deg, var(--success) 0%, #38ef7d 100%);
    border-radius: 12px;
    text-align: center;
    margin-top: 1rem;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.total-gpa-result.show {
    display: block;
    animation: slideIn 0.5s ease;
}

/* Paper fields for 150 marks */
.paper-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Help Section */
.help-section {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.help-section h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.help-section p {
    color: var(--text-light);
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.help-section strong {
    color: var(--text-dark);
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        gap: 5px;
        z-index: 1000;
    }

    .mobile-menu-toggle span {
        width: 25px;
        height: 3px;
        background: var(--white);
        border-radius: 2px;
    }

    .main-nav {
        position: fixed;
        top: 60px; /* places it just below the fixed header */
        right: -250px; /* hidden offscreen */
        width: 250px;
        height: auto; /* sidebar only takes space of its links */
        background: var(--secondary-blue);
        flex-direction: column;
        padding: 2rem 1rem;
        box-shadow: -2px 0 10px rgba(0,0,0,0.2);
        opacity: 0;
        z-index: 999;
        border-radius: 0 0 0 12px; /* optional border-radius for dropdown effect */
        transition: right 0.3s ease, opacity 0.3s ease; /* smooth transition */
    }

    .main-nav ul {
        flex-direction: column;
        gap: 1.5rem;
        padding: 0;
    }

    .main-nav ul li {
        width: 100%;
    }

    .main-nav.active {
        right: 0; /* slide in */
        opacity: 1;
    }

    .nav-link {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

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

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

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

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

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

    /* GPA Calculator Mobile Styles */
    .calculator-container {
        padding: 2rem;
        margin: 1rem;
    }

    .calculator-container h1 {
        font-size: 2rem;
    }

    .paper-fields {
        grid-template-columns: 1fr;
    }

    .subject-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .subject-row label {
        min-width: auto;
        width: 100%;
    }

    .main-content {
        padding: 100px 0 2rem;
    }
}

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

    .hero-section {
        padding: 120px 0 80px;
    }

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

    section {
        padding: 60px 0;
    }

    .tool-card {
        padding: 1.5rem;
    }

    /* GPA Calculator Mobile Styles */
    .calculator-container {
        padding: 1.5rem;
    }

    .calculator-container h1 {
        font-size: 1.8rem;
    }

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

    /* Additional styles for new features */
    .add-subjects-btn {
        background: linear-gradient(135deg, #10b981 0%, #38ef7d 100%);
        color: white;
        border: none;
        padding: 12px 24px;
        border-radius: 8px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
        margin: 1rem auto;
        display: block;
        font-size: 1rem;
    }

    .add-subjects-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    }

    .editable-label {
        cursor: pointer;
        position: relative;
        transition: all 0.3s ease;
        border-radius: 4px;
        padding: 2px 4px;
    }

    .editable-label:hover {
        background-color: rgba(37, 99, 235, 0.1);
    }

    .editable-label.editing {
        background-color: var(--white);
        border: 2px solid var(--primary-blue);
    }

    .editable-input {
        border: none;
        background: transparent;
        font-weight: 600;
        color: var(--text-dark);
        padding: 2px 4px;
        width: 200px;
        font-size: inherit;
        font-family: inherit;
    }

    .editable-input:focus {
        outline: none;
    }

    .subject-tooltip {
        position: relative;
    }

    .subject-tooltip::after {
        content: "Double-click to edit";
        position: absolute;
        bottom: -25px;
        left: 0;
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 0.8rem;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        white-space: nowrap;
        z-index: 10;
    }

    .subject-tooltip:hover::after {
        opacity: 1;
        visibility: visible;
    }

    .remove-subject-btn {
        background: #ef4444;
        color: white;
        border: none;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 0.85rem;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-left: 10px;
    }

    .remove-subject-btn:hover {
        background: #dc2626;
        transform: scale(1.05);
    }

    .dynamic-subject {
        position: relative;
    }

    .subjects-counter {
        text-align: center;
        color: var(--text-light);
        font-size: 0.9rem;
        margin-bottom: 1rem;
        font-weight: 500;
    }
    
/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }