@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #fff5f6;
    --card-bg: #ffffff;
    --primary: #d90429;
    --primary-light: #ffccd5;
    --primary-hover: #ef233c;
    --secondary: #fb8b24;
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --border-color: #f0a6b2;
    --shadow-soft: 0 8px 30px rgba(217, 4, 41, 0.06);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.04);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --max-width: 480px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #fff8f9;
    background-image: url('/images/bg.png');
    background-size: 300px; /* repeats line art pattern beautifully */
    background-repeat: repeat;
    background-attachment: fixed;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Constrain App to Mobile Frame on Desktop */
#app-container {
    width: 100%;
    max-width: var(--max-width);
    background: rgba(255, 245, 246, 0.85); /* Translucent soft pink backdrop */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 45px rgba(217, 4, 41, 0.08);
    overflow: hidden;
}

/* Header Navbar */
header {
    background: rgba(255, 255, 255, 0.75); /* Translucent header */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    flex-wrap: nowrap;
    gap: 6px;
    flex-wrap: nowrap;
    gap: 6px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-shrink: 1;
}

.logo-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    flex-shrink: 0;
}

.logo-text {
    font-size: clamp(0.8rem, 3.5vw, 1.15rem);
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}

/* Main Content Wrapper */
main {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Utility Components */
.card {
    background: rgba(255, 255, 255, 0.7); /* Translucent cards for glassmorphism */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(240, 166, 178, 0.25);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f8d7da;
    padding-bottom: 8px;
}

/* Form Styles with English & Roman Urdu support */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-main);
}

.form-group label span.urdu {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 400;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(217, 4, 41, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23d90429' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

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

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

.btn-secondary {
    background-color: #eaeaea;
    color: var(--text-main);
}

.btn-accent {
    background-color: var(--secondary);
    color: white;
}

/* Bottom Navigation Bar */
.bottom-nav {
    flex-shrink: 0;
    width: 100%;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    gap: 4px;
    transition: color 0.2s;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    transition: transform 0.2s;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item.active svg {
    transform: scale(1.1);
    stroke: var(--primary);
    fill: rgba(217, 4, 41, 0.05);
}

/* Alert Notification Styles */
.alert {
    padding: 12px 15px;
    border-radius: var(--radius-md);
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    font-weight: 500;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-shrink: 1;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Dashboard Styles */
.welcome-section {
    text-align: center;
    padding: 10px 0;
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
}

.welcome-sub {
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    color: var(--text-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-card {
    text-align: center;
    padding: 15px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Profiles List & Cards */
.profile-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.candidate-init {
    width: 45px;
    height: 45px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.8rem, 3.5vw, 1.15rem);
    font-weight: 700;
}

.candidate-name-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.profile-tag {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-bottom-left-radius: var(--radius-sm);
    font-weight: 600;
}

.profile-tag.boy {
    background: #0077b6; /* Blue badge for Larka */
}

.profile-tag.girl {
    background: #ec4899; /* Pink badge for Larki */
}

.profile-tag.pending {
    background: var(--secondary);
}

.profile-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-main);
    border-top: 1px solid #f8eaed;
    border-bottom: 1px solid #f8eaed;
    padding: 10px 0;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.detail-value {
    font-weight: 500;
}

/* Match compatibility Badge on profile details page */
.match-meter {
    background: linear-gradient(135deg, #d90429, #fb8b24);
    color: white;
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(217, 4, 41, 0.15);
}

.match-score {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
}

.match-text {
    flex: 1;
    margin-left: 15px;
}

.match-title {
    font-size: 1rem;
    font-weight: 600;
}

.match-desc {
    font-size: 0.75rem;
    opacity: 0.9;
}

main:has(.chat-container) {
    overflow-y: hidden;
}

/* WhatsApp-style Chat Room */
.chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    background-color: #efeae2; /* WhatsApp background */
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.chat-messages-area {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    word-wrap: break-word;
}

/* Sent by others */
.message-bubble.received {
    align-self: flex-start;
    background-color: var(--card-bg);
    border-top-left-radius: 2px;
}

/* Sent by current logged-in user */
.message-bubble.sent {
    align-self: flex-end;
    background-color: #d9fdd3; /* WhatsApp green */
    border-top-right-radius: 2px;
}

.message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--primary);
}

.message-sender.admin {
    color: #5a189a;
}

.message-bubble.sent .message-sender {
    color: #2b9348;
}

.message-text {
    color: #303030;
    line-height: 1.4;
}

.message-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 4px;
}

.chat-input-area {
    background: #f0f2f5;
    padding: 10px 15px;
    display: flex;
    gap: 6px;
    min-width: 0;
    flex-shrink: 1;
    align-items: center;
    border-top: 1px solid #e1e3e6;
}

.chat-input {
    flex: 1;
    border: none;
    padding: 12px 15px;
    border-radius: 24px;
    outline: none;
    font-size: 0.95rem;
    background: white;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chat-send-btn:hover {
    background: var(--primary-hover);
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Tab panels for forms or lists */
.tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    padding: 12px 4px;
    text-align: center;
    background: none;
    border: none;
    font-size: clamp(0.58rem, 2.1vw, 0.85rem);
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Search Filters Styling */
.filter-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    padding: 10px 0;
    border-bottom: 1px solid #f8eaed;
}

.filters-wrapper {
    display: none;
    margin-top: 15px;
}

.filters-wrapper.open {
    display: block;
}

/* Empty State illustration helper */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 60px;
    height: 60px;
    stroke: var(--border-color);
    margin-bottom: 15px;
}

/* User Pending Page design */
.pending-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    flex: 1;
}

.pending-icon {
    width: 100px;
    height: 100px;
    background: #fff3cd;
    color: #856404;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(133, 100, 4, 0.1);
}

.pending-icon svg {
    width: 50px;
    height: 50px;
}

.pending-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-main);
}

.pending-message {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 30px;
}

.pending-urdu {
    font-size: 1.05rem;
    color: var(--primary);
    font-weight: 500;
    direction: rtl;
    line-height: 1.8;
    margin-bottom: 25px;
}

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(217, 4, 41, 0.3);
    text-decoration: none;
    z-index: 99;
}

.fab svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
}

/* Details Page Field Sections */
.profile-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin: 15px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px dashed var(--border-color);
}

.profile-section-title:first-of-type {
    margin-top: 0;
}

/* Custom Segmented Control for Gender Selection */
.gender-segmented-control {
    display: flex;
    background: #f1f3f5;
    border-radius: var(--radius-md);
    padding: 4px;
    border: 1px solid #e9ecef;
    margin-top: 5px;
}

.segment-item {
    flex: 1;
    text-align: center;
    cursor: pointer;
    margin: 0 !important; /* Override standard label margin */
}

.segment-item input:checked + .segment-label {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 6px rgba(217, 4, 41, 0.2);
}

.segment-label {
    display: block;
    padding: 10px;
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    user-select: none;
}
