/* ============================================================
   STYLES.CSS - Chat 4DD - Germana Interactiv
   ============================================================ */

/* Variables */
:root {
    --primary: #1e3a5f;
    --primary-light: #2d5a8a;
    --primary-dark: #152a45;
    --secondary: #f0c14b;
    --secondary-dark: #d4a83a;
    --accent: #c9302c;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 20px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-lg: 20px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================================
   LOGO 4DD
   ============================================================ */
.logo-4dd {
    display: inline-flex;
    align-items: center;
    font-weight: 900;
    user-select: none;
}

.logo-4dd .logo-number {
    font-size: 2.5em;
    color: var(--secondary);
    text-shadow: 2px 2px 0 var(--primary-dark);
}

.logo-4dd .logo-letters {
    font-size: 2em;
    color: var(--white);
    margin-left: 2px;
}

.logo-4dd.small .logo-number {
    font-size: 1.5em;
}

.logo-4dd.small .logo-letters {
    font-size: 1.2em;
}

.logo-4dd.large .logo-number {
    font-size: 4em;
}

.logo-4dd.large .logo-letters {
    font-size: 3em;
}

.logo-4dd.animated .logo-number {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    gap: 20px;
}

.loading-screen p {
    opacity: 0.8;
    font-size: 14px;
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    padding: 20px;
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 1000px;
    min-height: 600px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Sidebar 30% */
.login-sidebar {
    width: 35%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand {
    text-align: center;
    margin-bottom: 40px;
}

.login-brand .slogan {
    font-size: 1.1em;
    opacity: 0.9;
    margin-top: 10px;
}

.login-brand .description {
    font-size: 0.9em;
    opacity: 0.7;
    margin-top: 15px;
    line-height: 1.6;
}

/* Stats rotative */
.login-stats {
    position: relative;
    min-height: 100px;
    margin: 30px 0;
}

.stat-item {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.stat-item.active {
    opacity: 1;
    transform: translateY(0);
}

.stat-icon {
    font-size: 2.5em;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
}

.stat-label {
    font-size: 0.85em;
    opacity: 0.8;
}

.stat-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.stat-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.stat-dots .dot.active {
    background: var(--secondary);
    transform: scale(1.2);
}

/* Form 70% */
.login-form-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-form {
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    font-size: 1.8em;
    color: var(--primary);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    font-size: 0.95em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 1em;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-group.checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
}

.form-group.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.login-footer {
    margin-top: 30px;
    text-align: center;
    color: var(--gray);
    font-size: 0.9em;
}

.link-whatsapp {
    display: inline-block;
    margin-top: 10px;
    color: var(--success);
    font-weight: 600;
    text-decoration: none;
}

.link-whatsapp:hover {
    text-decoration: underline;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark);
}

.btn-secondary:hover:not(:disabled) {
    background: #ddd;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.1em;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
}

.btn-whatsapp {
    background: #25D366;
    color: var(--white);
}

.btn-whatsapp:hover {
    background: #20bd5a;
}

/* ============================================================
   WAITING ROOM
   ============================================================ */
.waiting-room {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.waiting-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--white);
    text-align: center;
}

.waiting-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.waiting-icon .spinner {
    display: inline-block;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.waiting-room h1 {
    font-size: 2em;
    margin-bottom: 20px;
}

.waiting-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 30px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.waiting-user-info .avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--secondary);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
}

.waiting-user-info .user-details {
    text-align: left;
}

.waiting-user-info .user-details strong {
    display: block;
    font-size: 1.2em;
}

.waiting-user-info .user-details span {
    opacity: 0.8;
    font-size: 0.9em;
}

.waiting-message {
    max-width: 400px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.waiting-contact {
    margin-bottom: 30px;
}

.waiting-contact p {
    margin-bottom: 15px;
    opacity: 0.8;
}

.btn-logout {
    margin-top: 20px;
    background: rgba(255,255,255,0.2);
    color: var(--white);
}

.waiting-decoration {
    width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.1);
    opacity: 0.3;
}

/* ============================================================
   BLOCKED SCREEN
   ============================================================ */
.blocked-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    padding: 20px;
}

.blocked-content {
    text-align: center;
    max-width: 400px;
}

.blocked-icon {
    font-size: 4em;
    display: block;
    margin-bottom: 20px;
}

.blocked-content h1 {
    color: var(--danger);
    margin-bottom: 15px;
}

.blocked-content p {
    color: var(--gray);
    margin-bottom: 30px;
}

/* ============================================================
   CHAT ROOM
   ============================================================ */
.chat-room {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--light);
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow);
}

.chat-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-title h1 {
    font-size: 1.2em;
    margin: 0;
}

.online-count {
    font-size: 0.8em;
    opacity: 0.8;
    cursor: pointer;
}

.online-count:hover {
    opacity: 1;
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.btn-admin {
    background: var(--secondary);
    color: var(--primary-dark);
    position: relative;
}

.btn-admin .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: var(--white);
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
}

.chat-actions .btn-logout {
    background: rgba(255,255,255,0.2);
    padding: 10px 15px;
}

/* Online dropdown */
.online-dropdown {
    position: absolute;
    top: 70px;
    left: 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 15px;
    z-index: 100;
    min-width: 200px;
}

.online-dropdown h4 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 0.9em;
}

.online-dropdown ul {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.online-dropdown li {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.9em;
}

.online-dropdown li:hover {
    background: var(--light);
}

.online-dropdown li.admin {
    color: var(--secondary);
    font-weight: 600;
}

/* Messages container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.no-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray);
}

.no-messages span {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Messages list */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 80%;
}

.message.own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary);
    flex-shrink: 0;
}

.message.admin-msg .message-avatar {
    background: var(--secondary);
}

.message-content {
    display: flex;
    flex-direction: column;
}

.message-author {
    font-size: 0.75em;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 3px;
    margin-left: 10px;
}

.admin-badge {
    background: var(--secondary);
    color: var(--primary-dark);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 5px;
}

.message-bubble {
    background: var(--white);
    padding: 10px 14px;
    border-radius: 18px;
    border-top-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message.own .message-bubble {
    background: var(--primary);
    color: var(--white);
    border-radius: 18px;
    border-top-right-radius: 4px;
}

.message.admin-msg:not(.own) .message-bubble {
    background: #fff8e1;
    border: 1px solid var(--secondary);
}

.message-text {
    word-break: break-word;
    white-space: pre-wrap;
}

.message-link {
    color: var(--primary-light);
    text-decoration: underline;
}

.message.own .message-link {
    color: var(--secondary);
}

.message-time {
    font-size: 0.7em;
    opacity: 0.6;
    text-align: right;
    margin-top: 4px;
}

/* Typing indicator */
.typing-indicator {
    padding: 10px 20px;
    color: var(--gray);
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--gray);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input area */
.chat-input-area {
    padding: 15px 20px;
    background: var(--white);
    border-top: 1px solid var(--gray-light);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-wrapper textarea {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--gray-light);
    border-radius: 24px;
    font-size: 1em;
    resize: none;
    max-height: 120px;
    font-family: inherit;
}

.input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-send {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    font-size: 1.3em;
    padding: 0;
}

.btn-send:hover:not(:disabled) {
    background: var(--primary-light);
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 95vw;
    width: 100%;
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content.admin-modal {
    max-width: 1100px;
    height: 90vh;
}

.admin-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--primary);
    color: var(--white);
}

.admin-header h2 {
    margin: 0;
}

.btn-close {
    background: transparent;
    color: var(--white);
    font-size: 1.5em;
    padding: 5px 10px;
}

/* Admin stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
    background: var(--light);
}

.stat-box {
    background: var(--white);
    padding: 15px;
    border-radius: var(--radius);
    text-align: center;
}

.stat-box .stat-number {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: var(--primary);
}

.stat-box .stat-label {
    font-size: 0.8em;
    color: var(--gray);
}

.stat-box.pending .stat-number { color: var(--warning); }
.stat-box.approved .stat-number { color: var(--success); }
.stat-box.online .stat-number { color: var(--primary-light); }

/* Filters */
.admin-filters {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray-light);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid var(--gray-light);
    background: var(--white);
    border-radius: 20px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.pending.active { border-color: var(--warning); color: var(--warning); }
.filter-btn.approved.active { border-color: var(--success); color: var(--success); }
.filter-btn.blocked.active { border-color: var(--danger); color: var(--danger); }

/* Users table */
.admin-users {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 20px;
    min-height: 0;
    max-height: 100%;
}

.admin-users::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.admin-users::-webkit-scrollbar-track {
    background: var(--gray-light);
    border-radius: 4px;
}

.admin-users::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 4px;
}

.admin-users::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.admin-users table {
    width: 100%;
    border-collapse: collapse;
}

.admin-users th {
    text-align: left;
    padding: 12px;
    background: var(--light);
    font-size: 0.85em;
    color: var(--gray);
}

.admin-users td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-light);
    vertical-align: middle;
}

.admin-users tr:hover {
    background: var(--light);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary);
}

.role-badge {
    background: var(--secondary);
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    margin-left: 8px;
}

.status-badge {
    margin-left: 5px;
}

.contact-info {
    font-size: 0.85em;
    color: var(--gray);
}

.msg-count {
    text-align: center;
    font-weight: 600;
}

.last-seen {
    font-size: 0.85em;
    color: var(--gray);
}

.actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.btn-approve { background: var(--success); color: var(--white); }
.btn-block { background: var(--warning); color: var(--dark); }
.btn-promote { background: var(--secondary); color: var(--primary-dark); }
.btn-delete { background: var(--danger); color: var(--white); }

.you-badge {
    background: var(--gray-light);
    color: var(--gray);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
}

.admin-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--gray-light);
    justify-content: flex-end;
}

.no-users, .loading {
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

/* ============================================================
   ERROR MESSAGE
   ============================================================ */
.error-message {
    background: #fee2e2;
    color: var(--danger);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        min-height: auto;
    }
    
    .login-sidebar {
        width: 100%;
        padding: 30px 20px;
    }
    
    .login-stats {
        min-height: 80px;
    }
    
    .login-form-wrapper {
        padding: 30px 20px;
    }
    
    .waiting-room {
        flex-direction: column;
    }
    
    .waiting-decoration {
        display: none;
    }
    
    .chat-header {
        padding: 10px 15px;
    }
    
    .chat-brand .logo-4dd {
        display: none;
    }
    
    .message {
        max-width: 90%;
    }
    
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-users {
        overflow-x: auto;
    }
    
    .admin-users table {
        min-width: 600px;
    }
    
    .modal-content {
        max-height: 95vh;
        border-radius: var(--radius);
    }
    
    .modal-content.admin-modal {
        max-width: 100%;
        height: 95vh;
        margin: 10px;
        border-radius: var(--radius);
    }
}

@media (max-width: 480px) {
    .logo-4dd .logo-number {
        font-size: 2em;
    }
    
    .logo-4dd .logo-letters {
        font-size: 1.5em;
    }
    
    .admin-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 15px;
    }
    
    .stat-box {
        padding: 10px;
    }
    
    .stat-box .stat-number {
        font-size: 1.4em;
    }
}