/* ===================================================================
   KOPYN CORE STYLES - HOMEPAGE COLOR MATCHED
   Combined: global.css + components.css
   Shared across all pages - load this everywhere
=================================================================== */

/* ===================================================================
   HOMEPAGE COLOR VARIABLES - EXACT MATCH
=================================================================== */
:root {
    /* PRIMARY HOMEPAGE COLORS */
    --primary-blue: #3b82f6;
    --primary-dark-blue: #1e40af;
    --primary-light-blue: #60a5fa;
    --primary-accent: #93c5fd;
    
    /* HOMEPAGE TEXT COLORS */
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #94a3b8;
    
    /* HOMEPAGE BACKGROUNDS */
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-accent: #e2e8f0;
    
    /* LEGACY COMPATIBILITY */
    --primary: #3b82f6;
    --primary-dark: #1e40af;
    --secondary: #3b82f6;
    --secondary-light: #dbeafe;
    --accent: #45ad96;
    --accent-light: #e0f4f0;
    --light: #f8fafc;
    --gray: #666;
    --error: #dc3545;
    --success: #28a745;
    --text-dark: #333;
    --text-light: #f8f9fa;
}

/* ===================================================================
   RESET & BASE STYLES
=================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ===================================================================
   TYPOGRAPHY
=================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark-blue);
}

/* ===================================================================
   UTILITY CLASSES
=================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

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

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

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* ===================================================================
   BUTTON BASE STYLES - HOMEPAGE MATCHING
=================================================================== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark-blue)) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark-blue), #1d4ed8) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4) !important;
    color: white !important;
    text-decoration: none !important;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--bg-accent);
}

.btn-secondary:hover {
    background: var(--bg-accent);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--primary-dark-blue);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ===================================================================
   FORM ELEMENTS
=================================================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--bg-accent);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===================================================================
   CARD COMPONENTS
=================================================================== */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--bg-accent);
}

.card-header {
    padding: 1.5rem 1.5rem 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 0 1.5rem 1.5rem;
}

/* ===================================================================
   LOADING STATES
=================================================================== */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===================================================================
   NOTIFICATION STYLES
=================================================================== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.notification.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.notification.info {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark-blue));
}

/* ===================================================================
   MODAL COMPONENTS
=================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

/* Demo Modal Design - Override for demo modal specifically */
#demoModal .modal-content {
    background: linear-gradient(135deg, var(--bg-primary) 0%, #ffffff 100%);
    margin: 3% auto;
    padding: 0;
    border-radius: 20px;
    width: 95%;
    max-width: 1000px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

#demoModal .modal-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark-blue));
    color: white;
    padding: 40px 40px 30px;
    text-align: center;
    position: relative;
    border-bottom: none;
}

#demoModal .modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

#demoModal .modal-header h2 {
    margin: 0 40px 15px 0;
    font-size: 2rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    color: white;
}

#demoModal .modal-header p {
    margin: 0;
    font-size: 1.125rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    color: white;
}

#demoModal .modal-body {
    padding: 30px 40px;
}

/* Demo Launch Buttons */
#demoModal .demo-launch-buttons {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 20px !important;
    margin-top: 30px !important;
    width: 100% !important;
}

#demoModal .demo-launch-buttons .btn {
    padding: 20px 15px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: white;
    min-height: 90px;
    height: auto;
}

#demoModal .demo-launch-buttons .btn:hover {
    transform: translateY(-3px);
}

#demoModal .demo-launch-buttons .btn-standard {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

#demoModal .demo-launch-buttons .btn-standard:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

#demoModal .demo-launch-buttons .btn-deluxe {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: white;
}

#demoModal .demo-launch-buttons .btn-deluxe:hover {
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

#demoModal .demo-launch-buttons .btn-premium {
    background: linear-gradient(135deg, #0891b2, #0e7490) !important;
    color: white !important;
    border: none !important;
}

#demoModal .demo-launch-buttons .btn-premium:hover {
    box-shadow: 0 8px 25px rgba(8, 145, 178, 0.4) !important;
}

#demoModal .demo-btn-icon {
    font-size: 1.5rem;
    opacity: 0.9;
}

#demoModal .demo-btn-text {
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.3;
}

/* Close button styling for demo modal */
#demoModal .modal-header .close {
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    font-weight: bold;
    position: absolute;
    right: 25px;
    top: 25px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

#demoModal .modal-header .close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: scale(1.1);
}

/* Demo Buttons Container for Homepage CTA Section */
.demo-buttons-container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* Modal Animation */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

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

/* Standard Modal Styles */
.modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid var(--bg-accent);
    position: relative;
}

.modal-header h2 {
    margin: 0 40px 10px 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-header p {
    margin: 0;
    color: var(--text-muted);
}

.modal-body {
    padding: 30px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--text-primary);
}

/* Contact Modal Specific Styling - Sleek & Modern */
#contactModal .modal-content {
    max-width: 400px !important;
    width: 85% !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    margin: 5% auto !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

#contactModal .modal-header {
    padding: 20px 25px 15px !important;
    text-align: center !important;
}

#contactModal .modal-header h2 {
    font-size: 1.3rem !important;
    margin: 0 30px 8px 0 !important;
}

#contactModal .modal-header p {
    font-size: 0.9rem !important;
    margin: 0 !important;
    opacity: 0.8 !important;
}

#contactModal .modal-body {
    padding: 15px 25px 25px !important;
}

/* Simplified Form Layout - Single Column */
#contactModal .form-row {
    display: block !important;
    margin-bottom: 0 !important;
}

#contactModal .form-group {
    margin-bottom: 15px !important;
}

#contactModal .contact-form label {
    font-size: 0.85rem !important;
    margin-bottom: 4px !important;
    font-weight: 500 !important;
}

#contactModal .contact-form .form-input {
    padding: 10px 12px !important;
    font-size: 0.9rem !important;
    border-radius: 8px !important;
    border: 1px solid var(--bg-accent) !important;
}

#contactModal .contact-form textarea {
    min-height: 70px !important;
    max-height: 120px !important;
}

#contactModal .contact-form .btn {
    width: 100% !important;
    padding: 12px 20px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark-blue)) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin-top: 15px !important;
    position: relative !important;
    z-index: 100 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#contactModal .contact-form .btn:hover {
    background: linear-gradient(135deg, var(--primary-dark-blue), #1d4ed8) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35) !important;
}

/* Basic Contact Form Styles */
.contact-form {
    max-width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.contact-form .form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--bg-accent);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: white;
    color: var(--text-primary);
}

.contact-form .form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* ===================================================================
   BADGE COMPONENTS
=================================================================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: var(--primary-dark-blue);
}

/* ===================================================================
   STATUS COMPONENTS
=================================================================== */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator.success {
    background: #dcfce7;
    color: #166534;
}

.status-indicator.error {
    background: #fee2e2;
    color: #991b1b;
}

.status-indicator.warning {
    background: #fef3c7;
    color: #92400e;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.success {
    background: #16a34a;
}

.status-dot.error {
    background: #dc2626;
}

.status-dot.warning {
    background: #d97706;
}

/* ===================================================================
   PROGRESS COMPONENTS
=================================================================== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-accent);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark-blue));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ===================================================================
   TOOLTIP COMPONENTS
=================================================================== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: var(--text-primary);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.875rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-primary) transparent transparent transparent;
}

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

/* ===================================================================
   ALERT COMPONENTS
=================================================================== */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background: #f0fdf4;
    border-color: #16a34a;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border-color: #dc2626;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border-color: #d97706;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border-color: var(--primary-blue);
    color: var(--primary-dark-blue);
}

.alert-icon {
    font-size: 1.25rem;
    margin-top: 2px;
}

.alert-content h4 {
    margin: 0 0 4px 0;
    font-weight: 600;
}

.alert-content p {
    margin: 0;
    font-size: 0.875rem;
}

/* ===================================================================
   SPINNER COMPONENTS
=================================================================== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* ===================================================================
   DROPDOWN COMPONENTS
=================================================================== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px solid var(--bg-accent);
    z-index: 1;
    top: 100%;
    left: 0;
    margin-top: 4px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-item {
    color: var(--text-primary);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid var(--bg-secondary);
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--bg-primary);
    color: var(--primary-blue);
}

.dropdown-item:last-child {
    border-bottom: none;
}

/* ===================================================================
   RESPONSIVE UTILITIES
=================================================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .hidden-mobile {
        display: none !important;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .dropdown-content {
        position: fixed;
        top: auto !important;
        left: 10px !important;
        right: 10px !important;
        width: auto;
        min-width: auto;
    }

    /* Demo buttons container responsive */
    .demo-buttons-container {
        flex-direction: column;
        gap: 1rem;
    }

    .demo-buttons-container .btn {
        width: 100%;
        max-width: 280px;
    }

    /* Demo modal responsive */
    #demoModal .modal-content {
        width: 95%;
        max-width: none;
    }

    #demoModal .modal-header {
        padding: 25px 25px 20px;
    }

    #demoModal .modal-body {
        padding: 25px;
    }

    #demoModal .demo-launch-buttons {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    #demoModal .modal-header h2 {
        font-size: 1.5rem;
        margin-right: 50px;
    }

    #demoModal .demo-launch-buttons .btn {
        min-width: 200px;
        padding: 18px 25px;
        font-size: 1rem;
    }

    #demoModal .demo-btn-text {
        font-size: 0.875rem;
    }

    /* Contact Modal Mobile Fixes */
    #contactModal .modal-content {
        max-width: 95% !important;
        margin: 5% auto !important;
        max-height: 95vh !important;
    }

    #contactModal .modal-header {
        padding: 15px 20px !important;
    }

    #contactModal .modal-body {
        padding: 15px 20px 25px !important;
        max-height: 75vh !important;
    }

    #contactModal .form-row {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    #contactModal .contact-form .btn {
        font-size: 1rem !important;
        padding: 12px 20px !important;
    }
}

@media (min-width: 769px) {
    .hidden-desktop {
        display: none !important;
    }
}

@media (max-width: 1100px) {
    #demoModal .modal-content {
        max-width: 900px;
    }
}

@media (max-width: 900px) {
    #demoModal .demo-launch-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    #demoModal .demo-launch-buttons .btn:nth-child(3) {
        grid-column: 1 / -1;
        max-width: 300px;
        margin: 0 auto;
    }
}