/**
 * Simple Ajax Chat - CSS para WordPress
 * Estilos modernos e responsivos para o chat
 */

/* Reset e configurações básicas */
.sac-chat-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #111827;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: 500px !important;
    display: flex;
    flex-direction: column;
}

/* Loading Screen */
.sac-loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #122945 0%, #1e3a8a 100%);
    color: white;
}

.sac-loading-content {
    text-align: center;
}

.sac-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: sac-spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.sac-loading-content h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
}

.sac-loading-content p {
    margin: 0;
    opacity: 0.8;
}

/* Login Screen */
.sac-login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #ee5a00;
    color: white;
}

.sac-login-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.sac-login-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
}

.sac-login-header p {
    margin: 0 0 30px 0;
    opacity: 0.9;
}

.sac-login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sac-form-group {
    text-align: left;
}

.sac-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.sac-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.sac-form-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.sac-form-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

/* Chat Interface */
.sac-chat-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
.sac-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #ee5a00;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sac-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sac-header-left h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
}

.sac-online-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    opacity: 0.9;
}

.sac-status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: sac-pulse 2s infinite;
}

@keyframes sac-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.sac-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search Bar */
.sac-search-bar {
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.sac-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.sac-search-icon {
    position: absolute;
    left: 12px;
    color: #64748b;
}

.sac-search-input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

.sac-search-input:focus {
    outline: none;
    border-color: #122945;
    box-shadow: 0 0 0 3px rgba(18, 41, 69, 0.1);
}

.sac-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sac-search-clear:hover {
    background: #f1f5f9;
    color: #475569;
}

/* Messages Container */
.sac-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: #f8fafc;
}

.sac-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Messages */
.sac-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: sac-fadeIn 0.3s ease;
}

.sac-message-own {
    align-self: flex-end;
}

.sac-message-other {
    align-self: flex-start;
}

.sac-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
}

.sac-message-own .sac-message-header {
    justify-content: flex-end;
}

.sac-message-username {
    font-weight: 600;
    color: #374151;
}

.sac-message-time {
    color: #6b7280;
    font-size: 11px;
}

.sac-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.sac-message-own .sac-message-content {
    background: #EE5A00;
    color: white;
}

.sac-message-text {
    word-wrap: break-word;
    line-height: 1.5;
}

.sac-message-highlight {
    background: #fef3c7 !important;
    border: 2px solid #f59e0b;
}

@keyframes sac-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Area */
.sac-input-area {
    padding: 20px 24px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.sac-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.sac-input-container {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px;
    transition: all 0.2s ease;
}

.sac-input-container:focus-within {
    border-color: #e2e8f0;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.sac-message-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.5;
    max-height: 120px;
    min-height: 20px;
}

.sac-message-input:focus {
    outline: none;
}

.sac-send-btn {
    flex-shrink: 0;
    padding: 12px;
    background: #122945;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sac-send-btn:hover:not(:disabled) {
    background: #122945;
    transform: translateY(-1px);
}

.sac-send-btn:disabled {
    opacity: 1;
    cursor: not-allowed;
    transform: none;
}

/* Buttons */
.sac-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.sac-btn-primary {
    background: #122945;
    color: white;
}

.sac-btn-primary:hover {
    background: #122945;
    transform: translateY(-1px);
}

.sac-btn-icon {
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 6px;
}

.sac-btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Loading states */
.sac-btn-loading {
    display: none;
}

.sac-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: sac-spin 1s linear infinite;
}

/* Alerts */
.sac-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    animation: sac-slideInRight 0.3s ease;
}

.sac-alert-success {
    background: #122945;
    color: white;
}

.sac-alert-error {
    background: #ef4444;
    color: white;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .sac-chat-container {
        height: 100vh;
        border-radius: 0;
    }
    
    .sac-chat-header {
        padding: 16px 20px;
    }
    
    .sac-header-left h2 {
        font-size: 18px;
    }
    
    .sac-messages-container {
        padding: 16px 20px;
    }
    
    .sac-input-area {
        padding: 16px 20px;
    }
    
    .sac-message {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .sac-login-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .sac-header-right {
        gap: 4px;
    }
    
    .sac-btn-icon {
        padding: 6px;
    }
    
    .sac-message {
        max-width: 95%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .sac-chat-container {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .sac-messages-container {
        background: #111827;
    }
    
    .sac-message-content {
        background: #374151;
        color: #f9fafb;
    }
    
    .sac-input-container {
        background: #374151;
        border-color: #4b5563;
    }
    
    .sac-message-input {
        color: #f9fafb;
    }
    
    .sac-search-bar {
        background: #111827;
        border-color: #374151;
    }
    
    .sac-search-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .sac-input-area {
        background: #1f2937;
        border-color: #374151;
    }
} 