/* Modern Responsive Frontend Styles */

:root {
    --primary-color: #2271b1;
    --secondary-color: #1d2327;
    --text-color: #1d2327;
    --text-light: #646970;
    --border-color: #c3c4c7;
    --bg-light: #f6f7f7;
    --white: #ffffff;
    --success: #00a32a;
    --danger: #d63638;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--white);
}

/* Header */
.site-header {
    background: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo-img {
    height: 50px;
    width: auto;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    margin: 0;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
}

.site-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.site-nav a:visited {
    color: var(--text-color);
}

.site-nav a:hover,
.site-nav a:focus {
    color: var(--primary-color);
}

/* Sub-menu/Dropdown Support */
.menu-item-dropdown {
    position: relative;
}

.menu-item-parent {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s;
}

.menu-item-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    min-width: 200px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 5px;
}

.menu-item-dropdown:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-menu-item {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.2s;
}

.sub-menu-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

/* Mobile menu adjustments */
@media (max-width: 768px) {
    .menu-item-dropdown {
        width: 100%;
    }
    
    .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--bg-light);
        margin-top: 0;
        padding-left: 20px;
        display: none;
    }
    
    .menu-item-dropdown.active .sub-menu {
        display: block;
    }
    
    .menu-item-dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
    }
}

/* Chat Widget */
.chat-widget { position: fixed; right: 16px; bottom: 16px; z-index: 2000; }
.chat-fab {
    background: var(--primary-color);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}
.chat-panel {
    width: 340px;
    max-width: calc(100vw - 32px);
    height: 480px;
    max-height: calc(100vh - 80px);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    transition: height 0.3s ease;
}
.chat-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 12px;
    background: var(--secondary-color);
    color: #fff;
    cursor: pointer;
}
.chat-header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}
.chat-minimize, .chat-close { 
    background: transparent; 
    border: 0; 
    color: #fff; 
    font-size: 22px; 
    cursor: pointer; 
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}
.chat-minimize:hover, .chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}
.chat-panel.chat-minimized {
    height: auto;
    min-height: auto;
}
.chat-panel.chat-minimized .chat-header {
    cursor: pointer;
}
.chat-mode { display: flex; gap: 8px; padding: 10px; background: var(--bg-light); border-bottom: 1px solid var(--border-color); }
.chat-mode-btn {
    flex: 1;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
}
.chat-mode-btn.active { border-color: var(--primary-color); color: var(--primary-color); }
.chat-mode-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-messages { 
    flex: 1; 
    padding: 12px; 
    overflow-y: auto; 
    overflow-x: hidden;
    background: #fff; 
    max-height: 400px;
    scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Customer Info Form */
.chat-info-form {
    padding: 20px;
}
.chat-info-form h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: var(--text-color);
}
.chat-info-form .form-group {
    margin-bottom: 15px;
}
.chat-info-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}
.chat-info-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}
.chat-msg { margin: 8px 0; display: flex; }
.chat-msg-customer { justify-content: flex-end; }
.chat-msg-agent, .chat-msg-bot, .chat-msg-system { justify-content: flex-start; }
.chat-bubble {
    max-width: 80%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-light);
    font-size: 13px;
}
.chat-msg-customer .chat-bubble { background: rgba(34,113,177,0.12); border-color: rgba(34,113,177,0.22); }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border-color); background: #fff; }
.chat-input input { flex: 1; padding: 10px; border: 1px solid var(--border-color); border-radius: 8px; }
.chat-input button { padding: 10px 12px; border: 0; border-radius: 8px; background: var(--primary-color); color: #fff; font-weight: 700; cursor: pointer; }
.chat-footer { padding: 8px 10px; background: var(--bg-light); border-top: 1px solid var(--border-color); color: var(--text-light); }

@media (max-width: 480px) {
    .chat-panel { width: calc(100vw - 32px); height: 70vh; }
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
}

/* Main Content */
.site-main {
    min-height: calc(100vh - 200px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #135e96 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary-color);
}

/* Content Sections */
.content-section {
    padding: 60px 20px;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-color);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 18px;
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Grid Layouts */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.card {
    background: var(--white);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
}

.card-content {
    color: var(--text-light);
    line-height: 1.8;
}

/* Page Content */
.page-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 40px;
    text-align: center;
}

.page-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-color);
}

.page-meta {
    color: var(--text-light);
    font-size: 14px;
}

.page-body {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-color);
}

.page-body h2 {
    font-size: 32px;
    margin: 40px 0 20px;
    color: var(--text-color);
}

.page-body h3 {
    font-size: 24px;
    margin: 30px 0 15px;
    color: var(--text-color);
}

.page-body p {
    margin-bottom: 20px;
}

.page-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* Footer */
.site-footer {
    background: var(--secondary-color);
    color: white;
    padding: 40px 20px;
    margin-top: 80px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
}

.footer-section p,
.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    line-height: 1.8;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.footer-bottom .site-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.footer-bottom .powered-by {
    margin: 0;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

.footer-bottom .powered-by strong {
    color: white;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .site-nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        transition: left 0.3s;
        gap: 15px;
    }
    
    .site-nav.active {
        left: 0;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .page-title {
        font-size: 32px;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 20px;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}
