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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

/* Large desktop screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1300px;
        padding: 0 30px;
    }
    
    .form-section {
        max-width: 650px;
    }
    
    .textarea-tooltip {
        width: 350px;
        right: 30px;
    }
}

/* 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: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    min-height: 80px;
    position: relative;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.nav-left,
.nav-right {
    display: flex;
    gap: 2rem;
    flex: 1;
}

.nav-right {
    justify-content: flex-end;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

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

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

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

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

.nav-link:hover {
    color: #e74c3c;
    transform: translateY(-1px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    transition: width 0.3s ease;
}

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

.logo-container {
    display: flex;
    justify-content: center;
    flex: 1;
}

.logo {
    height: 28px;
    width: auto;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Main Content */
.main {
    padding: 3rem 0;
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
}

.form-section {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
    font-weight: 400;
}

/* Form Styles */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-label i {
    color: #e74c3c;
    font-size: 1rem;
}

.input-container,
.textarea-container {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
}

.clear-btn:hover {
    background: #ecf0f1;
    color: #e74c3c;
}

.textarea-container .clear-btn {
    top: 16px;
    transform: none;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #e74c3c;
    background: white;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
    transform: translateY(-1px);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.character-counter {
    text-align: right;
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    opacity: 1;
}

/* Submit Button */
.submit-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(231, 76, 60, 0.4);
}

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

/* Footer Styles */
.footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: auto;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: #ecf0f1;
}

.footer-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section p,
.footer-section li {
    color: #bdc3c7;
    line-height: 1.6;
}

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

.footer-section li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.footer-section li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: #e74c3c;
    font-size: 0.8rem;
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.contact-info i {
    color: #e74c3c;
    width: 16px;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 1rem;
    text-align: center;
}

.footer-bottom p {
    color: #95a5a6;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    /* Mobile Navigation */
    .mobile-menu-btn {
        display: flex;
    }
    
    .nav {
        padding: 1rem 0;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: left 0.3s ease;
        z-index: 100;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-left,
    .nav-right {
        flex-direction: column;
        gap: 2rem;
        align-items: center;
        justify-content: center;
    }
    
    .nav-link {
        font-size: 1.2rem;
        font-weight: 600;
        padding: 1rem;
        text-align: center;
        min-width: 120px;
    }
    
    .logo-container {
        flex: none;
        z-index: 101;
    }
    
    /* Main content adjustments */
    .main {
        padding: 2rem 0;
        min-height: calc(100vh - 140px);
    }
    
    .form-section {
        padding: 2rem 1.5rem;
        margin: 1rem;
        border-radius: 16px;
    }
    
    .form-header h1 {
        font-size: 2rem;
    }
    
    .form-header p {
        font-size: 1rem;
    }
    
    /* Improve touch targets */
    .form-input,
    .form-textarea {
        padding: 1.125rem;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 10px;
        min-height: 48px; /* Minimum touch target for inputs */
    }
    
    .form-textarea {
        min-height: 120px; /* Ensure textarea is large enough */
    }
    
    .submit-btn {
        padding: 1.125rem 2rem;
        font-size: 1rem;
        min-height: 48px; /* Minimum touch target size */
        width: 100%; /* Full width on mobile */
    }
    
    .clear-btn {
        width: 32px;
        height: 32px;
        right: 8px;
        min-width: 32px; /* Ensure minimum touch target */
    }
    
    /* Improve form spacing on mobile */
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .form-label {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Footer improvements */
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }
    
    .social-links {
        justify-content: center;
        gap: 1.5rem;
    }
    
    .social-link {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
}

/* Medium tablet breakpoint */
@media (max-width: 1024px) and (min-width: 769px) {
    .textarea-tooltip {
        width: 300px;
        right: 15px;
    }
    
    .form-section {
        max-width: 550px;
    }
}

/* Small tablet breakpoint */
@media (max-width: 768px) and (min-width: 481px) {
    .textarea-tooltip {
        width: auto;
        right: 15px;
        left: 15px;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .form-section {
        padding: 1.5rem 1rem;
        border-radius: 15px;
        margin: 0.5rem;
    }
    
    .form-header h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .form-header p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .form-input,
    .form-textarea {
        padding: 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .submit-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 0.75rem;
    }
    
    /* Improve form spacing on very small screens */
    .contact-form {
        gap: 1.25rem;
    }
    
    .form-group {
        margin-bottom: 0;
    }
    
    /* Adjust footer for very small screens */
    .footer-section h3 {
        font-size: 1.3rem;
    }
    
    .footer-section h4 {
        font-size: 1.1rem;
    }
    
    .footer-section p,
    .footer-section li {
        font-size: 0.9rem;
    }
    
    .social-link {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .container {
        padding: 0 8px;
    }
    
    .form-section {
        margin: 0.25rem;
        padding: 1.25rem 0.75rem;
    }
    
    .form-header h1 {
        font-size: 1.5rem;
    }
    
    .form-header p {
        font-size: 0.9rem;
    }
    
    .textarea-tooltip {
        bottom: 5px;
        right: 2px;
        left: 2px;
        max-height: 45vh;
    }
    
    .tooltip-body {
        padding: 0.75rem;
    }
    
    .tooltip-header {
        padding: 0.75rem;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 0.5rem;
    }
}

/* Animation for form elements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    animation: fadeInUp 0.6s ease-out forwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }

.submit-btn {
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

/* Hover effects for inputs */
.form-input:hover,
.form-textarea:hover {
    border-color: #d5d8dc;
    background: white;
}

/* Character counter color changes */
.character-counter.warning {
    color: #f39c12;
}

.character-counter.danger {
    color: #e74c3c;
    font-weight: 500;
}

/* Additional Mobile Optimizations */
@media (max-width: 768px) {
    /* Improve tap targets and accessibility */
    .nav-link,
    .submit-btn,
    .clear-btn,
    .social-link {
        -webkit-tap-highlight-color: rgba(231, 76, 60, 0.2);
    }
    
    /* Optimize scrolling performance */
    .nav-menu {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    /* Improve form accessibility on mobile */
    .form-input:focus,
    .form-textarea:focus {
        transform: none; /* Remove transform on mobile to prevent layout issues */
        box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    /* Optimize images for mobile */
    .logo {
        height: 24px;
    }
}

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

/* Landscape orientation optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .main {
        padding: 1rem 0;
    }
    
    .form-section {
        margin: 0.5rem;
        padding: 1.5rem;
    }
    
    .form-header h1 {
        font-size: 1.75rem;
        margin-bottom: 0.25rem;
    }
    
    .form-header p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
}

/* Dark mode support (respects user preference) */
@media (prefers-color-scheme: dark) {
    /* This can be expanded if dark mode is desired */
}

/* Textarea Tooltip Styles */
.textarea-tooltip {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 2px solid #e74c3c;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
}

.textarea-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

.tooltip-content {
    padding: 0;
}

.tooltip-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border-radius: 14px 14px 0 0;
    font-weight: 600;
    position: relative;
}

.tooltip-header i {
    font-size: 1.1rem;
}

.tooltip-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tooltip-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tooltip-body {
    padding: 1.25rem;
}

.tooltip-body p {
    margin: 0 0 0.75rem 0;
    color: #2c3e50;
    line-height: 1.5;
}

.tooltip-body ul {
    margin: 0 0 1rem 0;
    padding-left: 1.25rem;
}

.tooltip-body ul ul {
    margin: 0.5rem 0 0.5rem 0;
    padding-left: 1rem;
}

.tooltip-body li {
    margin-bottom: 0.5rem;
    color: #34495e;
    line-height: 1.4;
}

.tooltip-body ul ul li {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: #5a6c7d;
}

.tooltip-body li::marker {
    color: #e74c3c;
}

.tooltip-body ul ul li::marker {
    color: #95a5a6;
}

.tooltip-note {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-style: italic;
    margin: 1rem 0 0 0 !important;
    padding-top: 0.75rem;
    border-top: 1px solid #ecf0f1;
}

/* Mobile tooltip adjustments */
@media (max-width: 768px) {
    .textarea-tooltip {
        position: fixed;
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
        width: auto;
        transform: translateY(0);
        max-height: 60vh;
    }
    
    .textarea-tooltip.show {
        transform: translateY(0) scale(1);
    }
    
    .tooltip-body {
        padding: 1rem;
    }
    
    .tooltip-header {
        padding: 0.875rem 1rem;
    }
}

@media (max-width: 480px) {
    .textarea-tooltip {
        bottom: 10px;
        right: 5px;
        left: 5px;
        max-height: 50vh;
    }
    
    .tooltip-body {
        padding: 0.875rem;
    }
    
    .tooltip-body ul {
        padding-left: 1rem;
    }
}

/* Reduced motion support for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .nav-menu {
        transition: none;
    }
    
    .hamburger-line {
        transition: none;
    }
    
    .textarea-tooltip {
        transition: none;
    }
}

