/* CSS Custom Properties */
:root {
    --background: 0 0% 0%; /* Black */
    --foreground: 0 0% 100%; /* White */
    --primary: 210 100% 50%; /* Blue accent */
    --primary-hover: 210 100% 45%;
    --border: 0 0% 20%;
    --modal-bg: 0 0% 5%;
    --overlay: 0 0% 0% / 0.8;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.6;
    min-height: 100vh;
}

/* Page Layout */
.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Grid Layout for Three Cells */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2rem;
    width: 100%;
    max-width: 1000px;
}

/* Cell A: Logo Area (Top Left) */
.cell-a {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.logo {
    max-width: 100%;
    height: auto;
    width: 375px;
}

/* Cell B: Text Content Area (Top Right) */
.cell-b {
    grid-column: 2;
    grid-row: 1;
    padding: 1rem;
}

.cell-b h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: hsl(var(--foreground));
    white-space: nowrap;
}

.cell-b p {
    margin-bottom: 1rem;
    color: hsl(var(--foreground) / 0.9);
}

.contact-btn {
    background-color: hsl(var(--primary));
    color: hsl(var(--foreground));
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
    text-decoration: none;
    display: inline-block;
}

.contact-btn:hover {
    background-color: hsl(var(--primary-hover));
    text-decoration: none;
}

/* Cell C: Navigation Menu (Bottom, Full Width) */
.cell-c {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 1rem;
    border-top: 1px solid hsl(var(--border));
}

.horizontal-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.horizontal-nav a {
    color: hsl(var(--foreground));
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: 4px;
    transition: all 0.3s ease;
}

.horizontal-nav a:hover {
    background-color: hsl(var(--foreground));
    color: hsl(var(--background));
}

/* Footer */
.footer {
    background-color: hsl(var(--background));
    border-top: 1px solid hsl(var(--border));
    padding: 1rem;
    text-align: center;
    margin-top: auto;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.footer p {
    color: hsl(var(--foreground) / 0.7);
    font-size: 0.9rem;
}

.footer-brand {
    margin-top: 1rem;
    text-align: center;
}

.footer-brand-image {
    width: 150px;
    max-width: 150px;
    height: auto;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: hsl(var(--overlay));
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: hsl(var(--modal-bg));
    border: 1px solid hsl(var(--border));
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
}

.modal-header h2 {
    color: hsl(var(--foreground));
    margin: 0;
}

.close {
    color: hsl(var(--foreground) / 0.7);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: hsl(var(--foreground));
}

.modal-body {
    padding: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: 4px;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: hsl(var(--primary));
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--foreground));
}

.btn-primary:hover {
    background-color: hsl(var(--primary-hover));
}

.btn-secondary {
    background-color: transparent;
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
}

.btn-secondary:hover {
    background-color: hsl(var(--border));
}

/* Alert Messages */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: hsl(var(--primary));
    color: hsl(var(--foreground));
    padding: 1rem;
    border-radius: 4px;
    z-index: 1001;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

.alert.hidden {
    display: none;
}

.alert.error {
    background-color: hsl(0 85% 50%);
}

.alert.success {
    background-color: hsl(120 60% 40%);
}

.alert-close {
    margin-left: 1rem;
    cursor: pointer;
    font-weight: bold;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .footer {
        padding: 1rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 1.5rem;
    }
    
    .cell-a {
        grid-column: 1;
        grid-row: 1;
    }
    
    .cell-b {
        grid-column: 1;
        grid-row: 2;
    }
    
    .cell-c {
        grid-column: 1;
        grid-row: 3;
    }
    
    .cell-b h1 {
        font-size: 1.5rem;
    }
    
    .horizontal-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .horizontal-nav a {
        width: 100%;
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0.5rem;
    }
    
    .footer {
        padding: 1rem 0.5rem;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-header,
    .modal-body {
        padding: 1rem;
    }
    
    .alert {
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        min-width: auto;
    }
}
