/* ===== ROOT VARIABLES ===== */
:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --accent-color: #fd79a8;
    --light-bg: #f8f9fa;
    --dark-text: #2d3436;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --text-muted: #6c757d;
    --border-color: rgba(0,0,0,0.05);
    --shadow-color: rgba(0,0,0,0.05);
}

[data-bs-theme="dark"] {
    --primary-color: #7d6df1;
    --secondary-color: #8479e6;
    --accent-color: #ff8fab;
    --light-bg: #1a1a2e;
    --dark-text: #f8f9fa;
    --card-bg: #16213e;
    --header-bg: #0f3460;
    --text-muted: #a0aec0;
    --border-color: rgba(255,255,255,0.05);
    --shadow-color: rgba(0,0,0,0.3);
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: #00008B;
    transition: all 0.3s ease;
}

/* ===== GRID LAYOUTS ===== */
.dashboard-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 10vh;
    width: 100%;
    gap: 0;
}

.main-content {
    padding: 2rem;
    background-color: var(--light-bg);
    transition: all 0.3s ease;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* ===== CARD/STAT ELEMENTS ===== */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 6px var(--shadow-color);
    background-color: var(--card-bg);
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
    color: var(--dark-text);
    overflow: visible;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

.card-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-radius: 10px 10px 0 0 !important;
    transition: all 0.3s ease;
    color: var(--dark-text);
}

.card-body {
    color: var(--dark-text);
    padding: 1.5rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--card-bg);
    border-radius: 10px;
    min-height: 85%;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: grey;
    opacity: 0.8;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Event Cards */
.event-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.2rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--dark-text);
    justify-content: space-around;
}

.event-date {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    min-width: 70px;
}

.event-day {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
}

.event-month {
    font-size: 0.7rem;
    text-transform: uppercase;
}

.event-info {
    color: grey;
}

.event-info h6 {
    color: maroon;
    margin-bottom: 0.25rem;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-container {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
        opacity: 0.8;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 0.75rem;
    }
    
    .card-body {
        padding: 0.2rem;
    }
    
    .event-card {
        gap: 0.1rem;
        padding: 0.35rem;
        text-align: center;
    }
    
    .event-date {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 75px;
        min-height: 98%;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .event-date .event-day {
        font-size: 1.2rem;
        margin: 0;
    }
    
    .event-date .event-month {
        font-size: 0.7rem;
    }
    
    .event-info {
        text-align: center;
    }
    
    .event-card .d-flex.flex-column {
        display: flex;
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }
    
    /* Birthday banner */
    .birthday-banner {
        padding: 0.75rem;
        text-align: center;
    }
    
    .birthday-banner h4 {
        font-size: 1rem;
    }
    
    .birthday-banner .btn {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Today events */
    .today-events-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .today-event-date {
        width: 40px;
        height: 40px;
        font-size: 0.7rem;
    }
    
    .friend-circle-img {
        width: 32px;
        height: 32px;
    }
    
    /* Table */
    .table-responsive {
        font-size: 0.8rem;
        overflow-x: auto;
    }
    
    .table-responsive td,
    .table-responsive th {
        padding: 0.4rem 0.3rem;
        color: var(--dark-text);
    }
    
    /* Love Network */
    .love-network-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .truncate-text {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .stats-grid {
        gap: 0.5rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.65rem;
        opacity: 0.8;
    }
    
    .col-6 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    
    .event-card .d-flex.flex-column {
        flex-direction: row;
        align-items: center;
    }
    
    .event-card .d-flex.flex-wrap.gap-2 {
        justify-content: center;
    }
    
    .card .btn-sm {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    .progress {
        height: 6px !important;
    }
    
    .truncate-text {
        max-width: 60px !important;
    }
    
    .video-container .card-header {
        padding: 0.5rem;
    }
    
    .video-container .card-header h5 {
        font-size: 0.9rem;
    }
}

/* Border breakpoints */
@media (min-width: 576px) {
    .border-end-sm {
        border-right: 1px solid var(--border-color);
        padding-right: 1rem;
    }
}

@media (max-width: 575.98px) {
    .border-end-sm {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }
}

/* Video responsive */
.video-responsive {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-responsive iframe,
.video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.fb-video-responsive {
    position: relative;
    padding-bottom: 177.78%;
    height: 0;
    overflow: hidden;
}

.fb-video-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #2d3748;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Dark mode fixes */
[data-bs-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-bs-theme="dark"] .text-primary {
    color: var(--primary-color) !important;
}

[data-bs-theme="dark"] .text-secondary {
    color: var(--secondary-color) !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: var(--light-bg) !important;
}

[data-bs-theme="dark"] .border {
    border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .badge.bg-secondary {
    background-color: #4a5568 !important;
}

[data-bs-theme="dark"] .badge.bg-light {
    background-color: #2d3748 !important;
    color: var(--dark-text) !important;
}

[data-bs-theme="dark"] .table {
    color: var(--dark-text);
}

[data-bs-theme="dark"] .table td,
[data-bs-theme="dark"] .table th {
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(1);
}

/* ============================================================
   PROFILE CSS
   ============================================================ */

/* ============================================================
   PROFILE & USER PICTURE
   ============================================================ */

.profile-picture-display,
.profile-avatar {
    width: 100px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    border: 3px solid #f0f0f0;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    margin-bottom: 1.5rem;
}

.avatar-image,
.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #f3f4f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.avatar-image:hover,
.profile-image:hover {
    transform: scale(1.03);
}

.avatar-initials {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: bold;
    border: 4px solid #f3f4f6;
}


/* ============================================================
   PROFILE HEADER
   ============================================================ */

.profile-card,
.profile-header {
    text-align: center;
}

.profile-username {
    font-size: 2rem;
    font-weight: 700;
    color: #333333;
    margin: 0 0 0.5rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.profile-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.meta-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.meta-item.verified {
    color: #3b82f6;
}

.meta-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}


/* ============================================================
   PROFILE CONTAINER
   ============================================================ */

.profile-container {
    width: 100%;
    max-width: 100%;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}


/* ============================================================
   PROFILE DETAILS
   ============================================================ */

.profile-details {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(280px, 1fr)
    );
    gap: 1rem;
    margin: 2rem 0;
    max-width: 100%;
}


/* ============================================================
   DETAIL CARD
   ============================================================ */

.detail-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    min-width: 0;
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 12px;
    box-sizing: border-box;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease;
}

.detail-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}


/* ============================================================
   DETAIL ICON
   ============================================================ */

.detail-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-icon svg {
    width: 20px;
    height: 20px;
    fill: #4b5563;
}


/* ============================================================
   DETAIL CONTENT
   ============================================================ */

.detail-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.detail-content label {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.detail-content p {
    margin: 0;
    font-weight: 500;
    color: #333333;
    line-height: 1.4;

    /* Prevent long values from breaking mobile layout */
    overflow-wrap: anywhere;
    word-break: break-word;
}


/* ============================================================
   PROFILE ACTIONS
   ============================================================ */

.profile-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;

    padding: 0.75rem 1.5rem;

    background: var(--primary-color);
    color: white;

    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease;
}

.edit-button:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.edit-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}


/* ============================================================
   TABLET RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {

    .profile-container {
        padding: 1.25rem;
        border-radius: 14px;
    }

    .profile-header {
        padding: 0.5rem 0;
    }

    .profile-avatar {
        width: 95px;
        height: 95px;
        margin-bottom: 1rem;
    }

    .avatar-initials {
        font-size: 2.3rem;
    }

    .profile-username {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 0.4rem;
        color: #333333;
    }

    .profile-meta {
        gap: 0.5rem 1rem;
        margin-top: 0.75rem;
        font-size: 0.85rem;
    }

    .profile-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin: 1.5rem 0;
    }

    .detail-card {
        padding: 0.9rem;
        gap: 0.8rem;
        border-radius: 10px;
    }

    .detail-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .detail-icon svg {
        width: 18px;
        height: 18px;
    }

    .detail-content label {
        font-size: 0.75rem;
    }

    .detail-content p {
        font-size: 0.9rem;
        color: #333333;
    }

    .profile-actions {
        margin-top: 1.5rem;
    }

    .edit-button {
        width: 100%;
        padding: 0.75rem 1rem;
    }
}


/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */

@media (max-width: 576px) {

    .profile-container {
        width: 100%;
        padding: 1rem;
        border-radius: 12px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    }

    .profile-header {
        padding: 0.25rem 0;
    }

    .profile-avatar {
        width: 88px;
        height: 88px;
        margin-bottom: 0.8rem;
    }

    .avatar-initials {
        font-size: 2rem;
    }

    .profile-username {
        font-size: 1.3rem;
        line-height: 1.25;
        margin-bottom: 0.3rem;
        color: #333333;
    }

    .profile-meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.4rem 0.8rem;
        margin-top: 0.6rem;
        font-size: 0.78rem;
    }

    .meta-icon {
        width: 14px;
        height: 14px;
    }

    .profile-details {
        gap: 0.65rem;
        margin: 1.25rem 0;
    }

    .detail-card {
        padding: 0.75rem;
        gap: 0.7rem;
        border-radius: 10px;
    }

    .detail-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .detail-icon svg {
        width: 17px;
        height: 17px;
    }

    .detail-content label {
        font-size: 0.72rem;
        margin-bottom: 0.15rem;
    }

    .detail-content p {
        font-size: 0.88rem;
        line-height: 1.35;
        color: #333333;
    }

    .profile-actions {
        margin-top: 1.25rem;
    }

    .edit-button {
        width: 100%;
        font-size: 0.9rem;
        padding: 0.7rem 1rem;
        border-radius: 8px;
    }
}


/* ============================================================
   VERY SMALL PHONES
   ============================================================ */

@media (max-width: 380px) {

    .profile-container {
        padding: 0.8rem;
        border-radius: 10px;
    }

    .profile-avatar {
        width: 78px;
        height: 78px;
    }

    .avatar-initials {
        font-size: 1.8rem;
    }

    .profile-username {
        font-size: 1.15rem;
        color: #333333;
    }

    .profile-meta {
        font-size: 0.72rem;
        gap: 0.35rem 0.6rem;
    }

    .detail-card {
        padding: 0.65rem;
        gap: 0.6rem;
    }

    .detail-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .detail-icon svg {
        width: 15px;
        height: 15px;
    }

    .detail-content label {
        font-size: 0.68rem;
    }

    .detail-content p {
        font-size: 0.82rem;
        color: #333333;
    }

    .edit-button {
        font-size: 0.85rem;
    }
}


/* ============================================================
   MOBILE TOUCH FEEDBACK
   ============================================================ */

@media (hover: none) and (pointer: coarse) {

    .detail-card:hover {
        transform: none;
        box-shadow: none;
    }

    .edit-button:hover {
        transform: none;
    }

    .detail-card:active {
        transform: scale(0.99);
    }

    .edit-button:active {
        transform: scale(0.98);
    }
}


/* ============================================================
   DARK MODE - PROFILE
   ============================================================ */

[data-bs-theme="dark"] .profile-container {
    background: var(--card-bg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .detail-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

[data-bs-theme="dark"] .detail-icon {
    background: #2d3748;
}

[data-bs-theme="dark"] .detail-icon svg {
    fill: #a0aec0;
}

[data-bs-theme="dark"] .detail-content label {
    color: var(--text-muted);
}

[data-bs-theme="dark"] .detail-content p {
    color: #333333;
}

[data-bs-theme="dark"] .profile-meta {
    color: var(--text-muted);
}

[data-bs-theme="dark"] .profile-username {
    color: #333333;
}

[data-bs-theme="dark"] .edit-button:hover {
    background: #4338ca;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}


/* ============================================================
   DARK MODE - MOBILE
   ============================================================ */

@media (max-width: 576px) {

    [data-bs-theme="dark"] .profile-container {
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    }

    [data-bs-theme="dark"] .detail-card {
        border-color: var(--border-color);
    }

    [data-bs-theme="dark"] .profile-username {
        color: #333333;
    }

    [data-bs-theme="dark"] .detail-content p {
        color: #333333;
    }
}


/* ============================================================
   SAFETY: PREVENT HORIZONTAL OVERFLOW .event-date
   ============================================================ */

.profile-container,
.profile-details,
.detail-card,
.detail-content {
    max-width: 100%;
    box-sizing: border-box;
}

.profile-username,
.detail-content p {
    overflow-wrap: anywhere;
    word-break: break-word;
}