﻿/* Global Styles */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa; /* Subtle light gray background */
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===================================
   STANDARDIZED COLOR SYSTEM
   Based on Projects page design
   =================================== */

:root {
    /* Primary Colors */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-gradient-hover: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    --primary-color: #667eea;
    --primary-dark: #5a6fd8;

    /* Background Colors */
    --bg-primary: #f8f9fa;
    --bg-white: #ffffff;
    --bg-card: #ffffff;

    /* Text Colors */
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-meta: #95a5a6;
    --text-light: rgba(255, 255, 255, 0.9);
    --text-white: #ffffff;

    /* Accent Colors */
    --accent-blue-bg: #e3f2fd;
    --accent-blue-text: #1976d2;
    --accent-success: #27ae60;
    --accent-warning: #f39c12;
    --accent-danger: #e74c3c;
    --accent-info: #17a2b8;

    /* Success Message Colors */
    --bg-success-light: #d4edda;
    --text-success: #155724;
    --border-success: #c3e6cb;

    /* Border Colors */
    --border-light: #e9ecef;
    --border-medium: #dee2e6;
    --border-dark: #adb5bd;

    /* Shadow Colors */
    --shadow-light: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 20px 40px rgba(0, 0, 0, 0.15);
    --shadow-button: 0 5px 15px rgba(102, 126, 234, 0.4);

    /* Border Radius */
    --border-radius-sm: 6px;
    --border-radius-md: 15px;
    --border-radius-lg: 25px;

    /* Transitions */
    --transition-fast: all 0.3s ease;
    --transition-slow: all 0.5s ease;
}

/* Standardized Hero Section */
.hero-section {
    background: var(--primary-gradient);
    color: var(--text-white);
    padding: 80px 0;
    text-align: center;
    margin: 20px 0; /* Remove auto centering, let container handle it */
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(102, 126, 234, 0.2);
    width: 100%; /* Full width within container */
}

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

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-white);
}

.hero-section p {
    font-size: 1.3rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-light);
}

/* Standardized Content Sections */
.content-section {
    padding: 40px 0;
    background-color: white; /* White content sections */
    margin: 20px 0; /* Remove auto centering, let container handle it */
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05); /* Subtle shadow */
    width: 100%; /* Full width within container */
}

.content-section.white-bg {
    background-color: white;
}

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

/* Standardized Cards */
.standard-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-light);
    transition: var(--transition-fast);
    overflow: hidden;
    height: 100%;
}

.standard-card:hover {
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
}

.card-content {
    padding: 30px;
}

.card-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.card-text {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Standardized Buttons */
.btn-primary-gradient {
    background: var(--primary-gradient);
    color: var(--text-white);
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius-lg);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    display: inline-block;
}

.btn-primary-gradient:hover {
    background: var(--primary-gradient-hover);
    color: var(--text-white);
    transform: scale(1.05);
    box-shadow: var(--shadow-button);
    text-decoration: none;
}

/* Standardized Tags */
.tag {
    background: var(--accent-blue-bg);
    color: var(--accent-blue-text);
    padding: 4px 12px;
    border-radius: var(--border-radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
    margin: 2px;
}

/* Standardized Meta Information */
.meta-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-meta);
}

.meta-info i {
    margin-right: 5px;
}

/* Modern Professional Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15); /* Softer shadow with brand color */
    position: sticky;
/*    top: 0; Commenting to let top scroll off */
    z-index: 1000;
    padding: 0;
    margin-bottom: 0; /* Remove any margin to prevent gaps */
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px; /* Container-constrained header */
    margin: 0 auto;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Ensure gradient extends */
    border-radius: 0 0 12px 12px; /* Subtle bottom rounding */
    box-shadow: 0 2px 15px rgba(102, 126, 234, 0.1); /* Additional inner shadow */
}

.header-logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.1);
    color: white;
    text-decoration: none;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

.header-logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: bold;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.header-logo:hover .header-logo-icon {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.header-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.header-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.header-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.header-nav a:hover::after {
    width: 80%;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
}

.header-auth .user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.header-auth .username {
    font-weight: 500;
    font-size: 0.9rem;
}

.header-auth .auth-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-auth a,
.header-auth button {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-auth a:hover,
.header-auth button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Main container content */
main {
    flex: 1;
    padding: 20px 0;
    background-color: #f8f9fa; /* Match body background */
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Content wrapper for consistent section widths */
main > section,
main > .hero-section,
main > .content-section {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: calc(100% - 40px); /* Account for padding */
}

/* Override container styling when used in main */
main.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Mobile-First Responsive System */
/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    gap: 4px;
    z-index: 1001;
}

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

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

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

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

/* Enhanced Mobile Responsiveness */
@media (max-width: 1024px) {
    .hero-section h1 {
        font-size: 2.8rem;
    }

    .hero-section p {
        font-size: 1.1rem;
    }

    .container {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .header-container {
        justify-content: space-between;
        padding: 15px 20px;
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding-top: 80px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        gap: 0;
    }

    .header-nav.mobile-active {
        right: 0;
    }

    .header-nav a {
        padding: 15px 20px;
        border-bottom: 1px solid var(--border-light);
        font-size: 1rem;
        color: var(--text-primary);
        text-decoration: none;
        transition: var(--transition-fast);
    }

    .header-nav a:hover {
        background: var(--bg-primary);
        color: var(--primary-color);
    }

    .hero-section {
        padding: 50px 0;
        margin: 10px 0;
    }

    .hero-section h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    .hero-section p {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    /* Touch-friendly buttons */
    .btn-primary-gradient,
    .btn-secondary-outline {
        min-height: 44px;
        padding: 12px 24px;
        font-size: 1rem;
    }

    /* Header auth adjustments */
    .header-auth {
        position: absolute;
        top: 80px;
        right: 20px;
        background: var(--bg-white);
        padding: 15px;
        border-radius: var(--border-radius-md);
        box-shadow: var(--shadow-light);
        display: none;
    }

    .header-nav.mobile-active ~ .header-auth {
        display: block;
    }
}

@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }

    .hero-section p {
        font-size: 0.95rem;
    }

    .header-nav {
        width: 100%;
        right: -100%;
    }

    .container {
        padding: 0 10px;
    }

    /* Ensure form inputs are touch-friendly */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 15px;
    }

    /* Stack elements vertically on very small screens */
    .admin-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   MOBILE FORM OPTIMIZATION
   =================================== */

/* Prevent zoom on input focus for iOS */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea,
select {
    font-size: 16px; /* Prevents iOS zoom */
    -webkit-appearance: none;
    appearance: none;
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--border-light);
    padding: 12px 15px;
    transition: var(--transition-fast);
    background: var(--bg-white);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Touch-friendly checkboxes and radio buttons */
input[type="checkbox"],
input[type="radio"] {
    min-width: 18px;
    min-height: 18px;
    margin-right: 8px;
}

/* Improved button touch targets */
button,
.btn-primary-gradient,
.btn-secondary-outline,
input[type="submit"],
input[type="button"] {
    min-height: 44px;
    min-width: 44px;
    cursor: pointer;
    touch-action: manipulation; /* Prevents double-tap zoom */
}

/* Mobile table responsiveness */
@media (max-width: 768px) {
    table {
        font-size: 0.9rem;
    }

    .info-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .info-table th,
    .info-table td {
        padding: 8px 12px;
    }
}

/* Accessibility improvements for mobile */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .mobile-menu-toggle span {
        transition: none;
    }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .header-nav {
        background: #2c3e50;
        color: white;
    }

    .header-nav a {
        color: #ecf0f1;
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .mobile-menu-toggle span {
        background: white;
    }
}

/* Improved Focus States for Accessibility */
@media (hover: none) and (pointer: coarse) {
    /* Touch device specific styles */
    .btn-primary-gradient:hover,
    .btn-secondary-outline:hover {
        transform: none; /* Disable hover transforms on touch devices */
    }

    .btn-primary-gradient:active,
    .btn-secondary-outline:active {
        transform: scale(0.98);
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .header-logo-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape Mobile Orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 30px 0;
    }

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

    .header-nav {
        padding-top: 60px;
    }
}

/* Modern Footer */
footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid #34495e;
    width: 100%;
    position: relative; /* Ensure it's not sticky */
    margin-top: auto; /* Push to bottom in flex layout */
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
    color: #bdc3c7;
}

footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px;
}

footer ul li a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

footer ul li a:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
    text-decoration: none;
}

@media (max-width: 768px) {
    footer .container {
        flex-direction: column;
        text-align: center;
    }

    footer ul {
        justify-content: center;
    }
}

/* Home Page Styles */
.home-banner {
    background-color: #87CEFA; /* Light Blue */
    padding: 5px 0;
    text-align: center;
    color: #333;
}

    .home-banner h1 {
        font-size: 3rem;
    }

    .home-banner p {
        font-size: 1.5rem;
    }

    .home-banner .btn {
        padding: 10px 20px;
        font-size: 1.2rem;
        background-color: #007bff;
        color: #fff;
        border: none;
        text-decoration: none;
    }

.home-content {
    padding: 20px 0;
    background-color: #fff;
    margin-top: 30px;
}

/* New "About Us" Section Styles */
.about-us-section {
    padding: 50px 0;
    background-color: #f4f4f4; /* Light gray background */
    text-align: center;
}

    .about-us-section h2 {
        font-size: 2.5rem;
        color: #007bff;
        margin-bottom: 20px;
    }

    .about-us-section p {
        font-size: 1.2rem;
        color: #666;
        line-height: 1.6;
        max-width: 1000px;
        margin: 0 auto;
    }

/* New section below the welcome message */
.services-section {
    padding: 40px 0;
    background-color: #f4f4f4; /* Light gray background */
    text-align: center;
}

    .services-section h2 {
        font-size: 2.5rem;
        color: #007bff;
        margin-bottom: 20px;
    }

.services-container {
    display: flex;
    justify-content: space-around; /* Distribute items evenly */
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
    gap: 20px;
}

.service-item {
    background-color: #fff;
    padding: 20px;
    width: 30%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

    .service-item h3 {
        font-size: 1.8rem;
        color: #0056b3;
        margin-bottom: 10px;
    }

    .service-item p {
        font-size: 1rem;
        color: #666;
    }

@media (max-width: 768px) {
    .service-item {
        width: 100%;
    }
}

.testimonials-section {
    padding: 40px 0;
    background-color: #f9f9f9;
    text-align: center;
}

    .testimonials-section h2 {
        font-size: 2.5rem;
        color: #0056b3;
        margin-bottom: 20px;
    }

.testimonials-container {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.testimonial-item {
    background-color: #fff;
    padding: 20px;
    width: 45%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

    .testimonial-item p {
        font-size: 1.2rem;
        color: #666;
    }

    .testimonial-item h4 {
        font-size: 1.5rem;
        color: #0056b3;
        margin-top: 10px;
    }

.auth-links {
    text-align: right;
    margin-top: 1rem;
}

.auth-form {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #f9f9f9;
}

    .auth-form h2 {
        text-align: center;
        margin-bottom: 20px;
    }

    .auth-form label {
        display: block;
        margin-top: 10px;
        font-weight: bold;
    }

    .auth-form input[type="text"],
    .auth-form input[type="email"],
    .auth-form input[type="password"] {
        width: 100%;
        padding: 10px;
        margin-top: 5px;
        border: 1px solid #ccc;
        border-radius: 5px;
    }

    .auth-form button {
        margin-top: 20px;
        width: 100%;
        padding: 10px;
        background-color: #007bff;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
    }

        .auth-form button:hover {
            background-color: #0056b3;
        }

.api-key-form {
    max-width: 600px;
    margin: 30px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fffbe6;
}

    .api-key-form label {
        display: block;
        margin-top: 10px;
        font-weight: 600;
    }

    .api-key-form input[type="text"],
    .api-key-form input[type="date"] {
        width: 100%;
        padding: 8px;
        margin-top: 5px;
        border-radius: 4px;
        border: 1px solid #ccc;
    }

    .api-key-form button {
        margin-top: 15px;
        padding: 10px 20px;
        background-color: #28a745;
        color: white;
        border: none;
        border-radius: 6px;
    }

        .api-key-form button:hover {
            background-color: #218838;
        }

.api-key-table {
    margin-top: 30px;
    width: 100%;
    border-collapse: collapse;
}

    .api-key-table th,
    .api-key-table td {
        padding: 10px;
        border: 1px solid #ccc;
        text-align: left;
    }

.about-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 50px 5%;
    background-color: #f9f9f9;
    gap: 40px;
}

.about-text {
    flex: 1;
    min-width: 300px;
    font-size: 1.1rem;
    color: #333;
}

    .about-text .headline {
        font-size: 3rem;
        font-weight: 600;
        margin-bottom: 20px;
    }

.about-image {
    flex: 1;
    text-align: center;
}

    .about-image img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
    }

.social-follow {
    margin-top: 30px;
}

    .social-follow p {
        font-weight: 600;
        margin-bottom: 10px;
    }

.social-icons {
    display: flex;
    gap: 16px;
    list-style: none;
    padding: 0;
    margin: 0;
}

    .social-icons li a svg {
        width: 32px;
        height: 32px;
        fill: #0C101C;
        transition: fill 0.2s ease;
    }

    .social-icons li a:hover svg {
        fill: #007bff; /* Highlight on hover */
    }