/* ===================================================
   LAND SOLUTIONS OF EAST TEXAS - MAIN STYLESHEET
   Production Ready CSS
   ================================================= */

/* === CSS VARIABLES === */
:root {
    --primary-blue: #1e3c72;
    --secondary-blue: #2a5298;
    --accent-red: #C41E3A;
    --dark-gray: #333;
    --text-gray: #666;
    --light-gray: #F5F5F5;
    --gray: #F8F9FA;
    --white: #FFFFFF;
    --black: #000000;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

/* === GLOBAL RESET === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === BASE STYLES === */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: var(--gray);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--dark-gray);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--secondary-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-blue);
}

/* === HEADER & NAVIGATION === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.company-banner {
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue));
    color: var(--white);
    text-align: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-img {
    height: 40px;
    width: auto;
    margin-right: 1rem;
}

.logo-fallback {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    margin-right: 1rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-menu a {
    color: var(--dark-gray);
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu a:hover {
    color: var(--secondary-blue);
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-info {
    color: var(--text-gray);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === BUTTONS === */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    justify-content: center;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-primary {
    background: var(--secondary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-secondary {
    background: var(--gray);
    color: var(--secondary-blue);
}

.btn-secondary:hover {
    background: var(--light-gray);
    color: var(--primary-blue);
}

.btn-outline {
    background: transparent;
    color: var(--secondary-blue);
    border: 2px solid var(--secondary-blue);
}

.btn-outline:hover {
    background: var(--secondary-blue);
    color: var(--white);
}

.btn-danger {
    background: var(--accent-red);
    color: var(--white);
}

.btn-danger:hover {
    background: #a01729;
    color: var(--white);
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    margin-top: 98px; /* Header height */
    padding: 2rem 0;
    min-height: calc(100vh - 98px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* === CARDS === */
.card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* === FORMS === */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-gray);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-blue);
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* === ALERTS === */
.messages-container {
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error,
.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.alert .close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.alert .close:hover {
    opacity: 1;
}

/* === FOOTER === */
.footer {
    background: var(--primary-blue);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

/* === MOBILE MENU === */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--dark-gray);
    margin: 5px 0;
    transition: var(--transition);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* === UTILITIES === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-gray); }

.bg-primary { background: var(--primary-blue); }
.bg-secondary { background: var(--secondary-blue); }
.bg-light { background: var(--gray); }
.bg-white { background: var(--white); }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .navbar {
        flex-wrap: wrap;
        padding: 1rem;
    }
    
    .main-content {
        margin-top: 140px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .footer-sections {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .btn {
        width: 100%;
    }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* === LOADING STATES === */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === ACCESSIBILITY === */
.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;
}

/* === PRINT STYLES === */
@media print {
    .header,
    .footer,
    .nav-menu,
    .nav-buttons,
    .ai-side-tab,
    .ai-chat-panel {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    body {
        font-size: 12pt;
        color: black;
        background: white;
    }
}

/* Tool indicator for when AI is searching */
.tool-indicator {
    padding: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.9em;
    color: #666;
    margin: 4px 0;
}

/* Source citations */
.ai-sources {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.source-link {
    display: block;
    font-size: 0.85em;
    color: #0066cc;
    text-decoration: none;
    padding: 2px 0;
}

.source-link:hover {
    text-decoration: underline;
}
