:root {
    --primary-color: #FF6B35;
    --secondary-color: #FFB347;
    --accent-color: #FFD700;
    --success-color: #4CAF50;
    --danger-color: #FF4757;
    --dark-color: #2C3E50;
    --light-color: #ECF0F1;
    --text-color: #34495E;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
    color: var(--text-color);
}

.container {
    display: none;
    width: 100%;
    height: 100vh;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.container.active {
    display: block;
    opacity: 1;
}

/* Auth Styles */
.auth-wrapper {
    max-width: 450px;
    margin: 50px auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.5s ease;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 60px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.logo-text {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.logo-text span {
    color: var(--primary-color);
}

.tagline {
    color: #7f8c8d;
    font-size: 14px;
    font-style: italic;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: #7f8c8d;
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #bdc3c7;
}

.input-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Chat App Styles */
.chat-app {
    display: flex;
    height: 100vh;
    background: white;
}

.sidebar {
    width: 350px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-xs {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.status-select {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    background: white;
    cursor: pointer;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #7f8c8d;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--danger-color);
}

.search-bar {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: #bdc3c7;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
}

.search-results {
    position: absolute;
    top: 100px;
    left: 15px;
    right: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.search-header {
    padding: 10px;
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.search-result-info {
    flex: 1;
}

.search-result-info strong {
    display: block;
    font-size: 14px;
}

.search-result-info small {
    font-size: 12px;
    color: #7f8c8d;
}

.add-contact-btn {
    padding: 5px 10px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.contacts-list {
    flex: 1;
    overflow-y: auto;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid #f0f0f0;
}

.contact-item:hover {
    background: #f8f9fa;
}

.contact-item.active {
    background: #fff3e0;
}

.contact-info {
    flex: 1;
}

.contact-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.contact-name strong {
    font-size: 14px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: var(--success-color);
}

.status-dot.away {
    background: var(--secondary-color);
}

.status-dot.offline {
    background: #95a5a6;
}

.contact-username {
    font-size: 12px;
    color: #7f8c8d;
}

.last-message {
    font-size: 12px;
    color: #95a5a6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.unread-badge {
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
}

.contact-time {
    font-size: 10px;
    color: #bdc3c7;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

.chat-header {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.chat-contact-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.message {
    display: flex;
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-content {
    max-width: 60%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
}

.message.sent .message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.message.received .message-content {
    background: white;
    color: var(--text-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message-text {
    word-wrap: break-word;
}

.message-time {
    font-size: 11px;
    margin-top: 5px;
    opacity: 0.7;
}

.message-status {
    margin-left: 5px;
    font-size: 10px;
}

.message-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.message-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.message-input-wrapper textarea {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    max-height: 100px;
}

.message-input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.send-btn:hover {
    transform: scale(1.05);
}

.emoji-picker {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
}

.emoji-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
}

.emoji-btn:hover {
    transform: scale(1.2);
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 60px 20px;
}

.welcome-message i {
    font-size: 80px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.welcome-message h3 {
    margin-bottom: 10px;
}

.filipino-quote {
    background: linear-gradient(135deg, rgba(206,17,38,0.1), rgba(0,56,167,0.1));
    border-radius: 15px;
    padding: 20px;
    margin-top: 30px;
    font-style: italic;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

.notification-success {
    border-left: 4px solid var(--success-color);
}

.notification-error {
    border-left: 4px solid var(--danger-color);
}

/* Animations */
@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -350px;
        transition: left 0.3s ease;
        z-index: 1000;
        width: 280px;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .message-content {
        max-width: 80%;
    }
    
    .auth-wrapper {
        margin: 20px;
        padding: 20px;
    }
    
    .logo-icon {
        font-size: 40px;
    }
    
    .logo-text {
        font-size: 24px;
    }
}

/* Loading States */
.loading-spinner {
    text-align: center;
    padding: 20px;
    color: #bdc3c7;
}

.no-contacts, .no-messages {
    text-align: center;
    padding: 40px;
    color: #bdc3c7;
}

.no-contacts i, .no-messages i {
    font-size: 48px;
    margin-bottom: 10px;
}

/* Error Message */
.error-message {
    background: #fee;
    color: var(--danger-color);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}