/* ============= FAMILY FACE - PURPLE THEME ============= */
:root {
    --primary: #8B5CF6;
    --primary-dark: #7C3AED;
    --primary-light: #A78BFA;
    --primary-soft: #DDD6FE;
    --secondary: #EC4899;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --dark: #1F2937;
    --gray: #6B7280;
    --light: #F9FAFB;
    --white: #FFFFFF;
    --gradient: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    --shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.3);
    --shadow-sm: 0 4px 6px -2px rgba(139, 92, 246, 0.2);
    --glass: rgba(255, 255, 255, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ============= GLASS MORPHISM CARDS ============= */
.glass-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
}

/* ============= AUTH CONTAINER ============= */
.auth-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.auth-card {
    background: white;
    border-radius: 30px;
    padding: 40px 30px;
    box-shadow: var(--shadow);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============= HEADER ============= */
.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 36px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--gray);
    font-size: 15px;
}

/* ============= TABS ============= */
.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: var(--light);
    padding: 6px;
    border-radius: 50px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* ============= FORMS ============= */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group.half {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

label i {
    color: var(--primary);
    margin-right: 8px;
}

input, textarea, select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--light);
    border-radius: 15px;
    font-size: 15px;
    transition: all 0.3s;
    background: var(--light);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.password-requirements {
    background: var(--light);
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
    font-size: 13px;
}

.password-requirements ul {
    margin: 10px 0 0 20px;
    color: var(--gray);
}

.password-requirements li {
    margin-bottom: 5px;
}

.hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--gray);
}

/* ============= FILE UPLOAD ============= */
.file-upload {
    position: relative;
}

.file-upload input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    background: var(--light);
    border: 2px dashed var(--primary);
    border-radius: 15px;
    color: var(--primary);
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
}

.file-upload-label:hover {
    background: var(--primary-soft);
    transform: scale(1.02);
}

/* ============= BUTTONS ============= */
.btn-primary {
    width: 100%;
    padding: 16px;
    border: none;
    background: var(--gradient);
    color: white;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--light);
    background: transparent;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline {
    padding: 12px 24px;
    border: 2px solid var(--primary);
    background: transparent;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* ============= LINKS ============= */
.form-footer {
    text-align: center;
    margin-top: 25px;
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.form-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============= TOAST NOTIFICATIONS ============= */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    min-width: 300px;
    background: white;
    border-radius: 15px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
    z-index: 9999;
    border-left: 4px solid;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--primary); }

.toast i {
    font-size: 24px;
}

.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--primary); }

.toast-message {
    flex: 1;
    font-size: 14px;
}

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

/* ============= LOADING SPINNER ============= */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .auth-card {
        padding: 30px 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .toast {
        min-width: auto;
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
}

/* ============= SCROLLBAR ============= */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}



/* ================= CHAT MESSAGES ================= */

.message {
    max-width: 65%;
    padding: 6px 10px;
    margin: 4px 8px;
    border-radius: 12px;
    position: relative;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.sent {
    background: #d9fdd3;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message.received {
    background: #ffffff;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin: 0;
}

/* MESSAGE BUBBLE */

.message-content {
    max-width: 65%;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    box-shadow: var(--shadow-sm);
}

/* SENT MESSAGE */

.message.sent .message-content {
    background: var(--primary);
    color: white;
    border-radius: 14px 14px 2px 14px;
}

/* RECEIVED MESSAGE */

.message.received .message-content {
    background: #f1f1f1;
    color: #333;
    border-radius: 14px 14px 14px 2px;
}

/* MESSAGE TIME */
.message-time {
    font-size: 11px;
    color: #667781;
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
}

.message-status {
    font-size: 12px;
    display: inline-flex;
    align-items: center;
}


/* Media Preview Container */
.media-preview-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: slideUp 0.3s ease;
}

.media-preview-content {
    background: #202c33;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    margin: 20px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #2d3b44;
}

.preview-header h4 {
    margin: 0;
    color: #e9edef;
    font-size: 18px;
}

.close-preview {
    background: none;
    border: none;
    color: #8696a0;
    font-size: 24px;
    cursor: pointer;
}

.close-preview:hover {
    color: #f15c6d;
}

.preview-body {
    padding: 20px;
    text-align: center;
    max-height: 50vh;
    overflow-y: auto;
}

.preview-image {
    max-width: 100%;
    max-height: 40vh;
    border-radius: 8px;
}

.preview-video {
    max-width: 100%;
    max-height: 40vh;
    border-radius: 8px;
}

.file-preview-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 30px;
}

.file-preview-body i {
    color: #00a884;
}

.file-preview-body .file-info {
    text-align: center;
}

.file-preview-body .file-name {
    color: #e9edef;
    font-size: 16px;
    margin-bottom: 5px;
}

.file-preview-body .file-size {
    color: #8696a0;
    font-size: 13px;
}

.preview-footer {
    display: flex;
    gap: 12px;
    padding: 15px 20px;
    border-top: 1px solid #2d3b44;
}

.cancel-preview-btn,
.send-preview-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-preview-btn {
    background: #2d3b44;
    color: #e9edef;
}

.cancel-preview-btn:active {
    background: #3d4b54;
}

.send-preview-btn {
    background: #00a884;
    color: #111b21;
}

.send-preview-btn:active {
    background: #008f72;
}

.send-preview-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

