/* ===================================
   MOBILE-FRIENDLY TITLES & HEADERS
   =================================== */

/* Page Headers - Responsive */
.page-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .page-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1.5rem 2rem;
        margin-bottom: 2rem;
    }
}

.page-header-content {
    flex: 1;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .page-header-actions {
        flex-shrink: 0;
    }
}

/* Title with Icon - Mobile Optimized */
.page-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    line-height: 1.3;
}

.page-title-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .page-title {
        font-size: 1.8rem;
        gap: 0.75rem;
    }
    
    .page-title-icon {
        font-size: 2rem;
    }
}

@media (min-width: 1024px) {
    .page-title {
        font-size: 2rem;
    }
    
    .page-title-icon {
        font-size: 2.2rem;
    }
}

/* Subtitle/Description */
.page-subtitle {
    margin: 0.5rem 0 0 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .page-subtitle {
        font-size: 1rem;
    }
}

/* Section Titles */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.section-header-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .section-header {
        font-size: 1.3rem;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
    
    .section-header-icon {
        font-size: 1.5rem;
    }
}

/* Card Title */
.card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.card-title-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .card-title {
        font-size: 1.15rem;
    }
    
    .card-title-icon {
        font-size: 1.3rem;
    }
}

/* Dashboard Title Specific */
.dashboard-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .dashboard-title {
        font-size: 2rem;
        gap: 0.75rem;
    }
}

@media (min-width: 1024px) {
    .dashboard-title {
        font-size: 2.2rem;
    }
}

/* Text Truncation Utilities */
.text-truncate-mobile {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .text-truncate-mobile {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }
}

.text-wrap-mobile {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Responsive Font Sizes - Utility Classes */
.fs-responsive-sm {
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .fs-responsive-sm {
        font-size: 0.9rem;
    }
}

.fs-responsive-base {
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    .fs-responsive-base {
        font-size: 1rem;
    }
}

.fs-responsive-lg {
    font-size: 1.1rem;
}

@media (min-width: 768px) {
    .fs-responsive-lg {
        font-size: 1.25rem;
    }
}

.fs-responsive-xl {
    font-size: 1.3rem;
}

@media (min-width: 768px) {
    .fs-responsive-xl {
        font-size: 1.5rem;
    }
}

/* Compact Header for Small Screens */
@media (max-width: 479px) {
    .page-title {
        font-size: 1.2rem;
    }
    
    .page-title-icon {
        font-size: 1.3rem;
    }
    
    .page-subtitle {
        font-size: 0.85rem;
    }
    
    .page-header {
        padding: 0.75rem;
    }
    
    .section-header {
        font-size: 1rem;
    }
    
    .section-header-icon {
        font-size: 1.1rem;
    }
}

/* Header Actions Optimization */
@media (max-width: 767px) {
    .page-header-actions button {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
    
    .page-header-actions .btn {
        font-size: 0.9rem;
        padding: 0.7rem 1rem;
    }
}

/* Prevent Orphan Icons */
.title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .title-group {
        flex-wrap: nowrap;
    }
}

/* Stat Cards Title */
.stat-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .stat-title {
        font-size: 0.85rem;
    }
}

/* Modal Title Optimization */
.modal-title-responsive {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .modal-title-responsive {
        font-size: 1.4rem;
        gap: 0.75rem;
    }
}

/* Emoji/Icon Size Control */
.emoji-sm {
    font-size: 1rem;
    display: inline-block;
}

.emoji-base {
    font-size: 1.2rem;
    display: inline-block;
}

.emoji-lg {
    font-size: 1.5rem;
    display: inline-block;
}

@media (min-width: 768px) {
    .emoji-sm {
        font-size: 1.2rem;
    }
    
    .emoji-base {
        font-size: 1.5rem;
    }
    
    .emoji-lg {
        font-size: 2rem;
    }
}

/* Fix for Long Text in Titles */
.title-text {
    flex: 1;
    min-width: 0; /* Allows text truncation if needed */
}

/* Better Spacing for Mobile Titles */
@media (max-width: 767px) {
    h1 + p,
    h2 + p,
    h3 + p {
        margin-top: 0.5rem;
        font-size: 0.9rem;
    }
    
    /* Reduce emoji prominence on very small screens */
    h1::before,
    h2::before,
    h3::before {
        font-size: 0.85em;
    }
}

/* Gradient Text Effect (Optional Enhancement) */
.title-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    .page-title,
    .section-header,
    .card-title {
        color: #e5e7eb;
    }
    
    .page-subtitle {
        color: #9ca3af;
    }
    
    .page-header {
        background: #1f2937;
    }
}
