/* Custom CSS for Cloudgap - Complementing Tailwind CSS */

/* CSS Variables for Design System */
:root {
    --cloudgap-blue: #1E88E5;
    --cloudgap-dark: #2E3440;
    --cloudgap-light: #F8F9FA;
    --spacing-unit: 8px;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 600;
}

/* Custom Components */

/* Hover Effects for Cards */
.hover-lift {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Focus States for Accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--cloudgap-blue);
    outline-offset: 2px;
}

/* Form Enhancements */
.form-input {
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-input:focus {
    border-color: var(--cloudgap-blue);
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
}

.form-input:invalid {
    border-color: #EF4444;
}

.form-input:invalid:focus {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Button Enhancements */
.btn {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--cloudgap-blue);
    border: 2px solid var(--cloudgap-blue);
}

.btn-primary:hover {
    background-color: #1976D2;
    border-color: #1976D2;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background-color: var(--cloudgap-blue);
    color: white;
}

/* Navigation Enhancements */
.nav-link {
    position: relative;
    transition: color 0.2s ease-in-out;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--cloudgap-blue);
    transition: width 0.2s ease-in-out;
}

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

/* Mobile Menu Animation */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.mobile-menu.active {
    max-height: 500px;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

/* Touch Targets for Mobile */
@media (max-width: 768px) {
    button,
    a[role="button"],
    .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
    }
    
    input,
    textarea,
    select {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --cloudgap-blue: #0066CC;
        --cloudgap-dark: #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 80%;
    }
    
    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }
}

/* Error States */
.error {
    color: #EF4444;
    background-color: #FEF2F2;
    border: 1px solid #FECACA;
}

.success {
    color: #059669;
    background-color: #F0FDF4;
    border: 1px solid #BBF7D0;
}

.warning {
    color: #D97706;
    background-color: #FFFBEB;
    border: 1px solid #FED7AA;
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--cloudgap-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Component-Specific Styles */

/* Partner Logo Grid */
.partner-logo {
    filter: grayscale(100%) opacity(0.7);
    transition: filter 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.partner-logo:hover {
    filter: grayscale(0%) opacity(1);
}

/* Service Cards */
.service-card {
    border-left: 4px solid transparent;
    transition: border-left-color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.service-card:hover {
    border-left-color: var(--cloudgap-blue);
    transform: translateX(4px);
}

/* Value Props */
.value-prop {
    transform: scale(1);
    transition: transform 0.2s ease-in-out;
}

.value-prop:hover {
    transform: scale(1.02);
}

/* Testimonials */
.testimonial {
    position: relative;
}

.testimonial::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: -10px;
    font-size: 4rem;
    color: var(--cloudgap-blue);
    opacity: 0.3;
    font-family: serif;
}

/* Gradient Overlays */
.gradient-overlay {
    background: linear-gradient(135deg, var(--cloudgap-blue), #1976D2);
}

.gradient-overlay-light {
    background: linear-gradient(135deg, var(--cloudgap-light), #ffffff);
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

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

.slide-up {
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.5s ease-out forwards;
}

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

/* Form Validation States */
.field-error {
    border-color: #EF4444;
    background-color: #FEF2F2;
}

.field-success {
    border-color: #059669;
    background-color: #F0FDF4;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Sticky Header Enhancement */
.sticky-header {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

/* Dark mode support preparation */
@media (prefers-color-scheme: dark) {
    /* Future dark mode styles can be added here */
}