/* Solar Projects App - Main Styles */

@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap; src:url('fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:500; font-display:swap; src:url('fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap; src:url('fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:700; font-display:swap; src:url('fonts/inter-700.woff2') format('woff2'); }

body {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

/* Table and List Styles */
.table-header-sortable { 
    cursor: pointer; 
    user-select: none; 
}

.table-header-sortable:hover { 
    background-color: #e5e7eb; 
}

.sort-indicator { 
    display: inline-block; 
    width: 16px; 
    height: 16px; 
    margin-left: 4px; 
    opacity: 0.5; 
    transition: opacity 0.2s, transform 0.2s; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5M7 9l5-5 5 5'/%3E%3C/svg%3E"); 
    background-size: contain; 
    background-repeat: no-repeat; 
}

.sort-indicator.active { 
    opacity: 1; 
}

.sort-indicator.asc { 
    transform: rotate(180deg); 
}

.sort-indicator.desc { 
    transform: rotate(0deg); 
}

/* Modal Styles */
.modal-backdrop { 
    background-color: rgba(0, 0, 0, 0.5); 
    transition: opacity 0.3s ease; 
}

.modal-content { 
    transition: transform 0.3s ease; 
}

/* Loading State */
.loading { 
    opacity: 0.6; 
    pointer-events: none; 
}


/* Project List Styles */
.project-item {
    transition: all 0.3s ease;
}

.project-item:hover {
    background-color: #f9fafb;
}

.project-item.expanded {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Sort Button Styles */
.sort-btn {
    transition: all 0.2s ease;
}

.sort-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sort-btn.active {
    background-color: #3b82f6;
    color: white;
}

/* Custom Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideDown {
    from { max-height: 0; opacity: 0; }
    to { max-height: 500px; opacity: 1; }
}

.slide-down {
    animation: slideDown 0.3s ease-out;
    overflow: hidden;
}

/* Status Badge Styles */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
    font-size: 0.75rem;
    line-height: 1rem;
}

/* Button Hover Effects */
.btn-hover-lift {
    transition: all 0.2s ease;
}

.btn-hover-lift:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* ── Maintenance CRM ──────────────────────────────────────────────────────── */

/* Filter pills */
.filter-pill {
    padding: 0.35rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1.5px solid #e5e7eb;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.filter-pill:hover  { border-color: #3b82f6; color: #3b82f6; }
.filter-pill:active { transform: scale(0.95); }
.filter-pill.active-pill { background: #3b82f6; color: white; border-color: #3b82f6; }

/* Client cards — mobile first */
.client-card {
    background: white;
    border-radius: 0.75rem;
    border: 1.5px solid #e5e7eb;
    transition: box-shadow 0.2s, border-color 0.2s;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.client-card:active { background: #fafafa; }
.client-card.is-new  { border-left: 4px solid #f97316; }
.client-card.expanded { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: #bfdbfe; }

/* Card detail panel animation */
.card-detail { animation: slideDown 0.18s ease; }

/* NEW badge */
.badge-new {
    display: inline-flex;
    align-items: center;
    background: #f97316;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.06em;
    transition: opacity 0.15s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.badge-new:active { opacity: 0.7; }

/* kWp badge */
.badge-kwp {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 5px;
    white-space: nowrap;
}

/* Quick action buttons — easy to tap on mobile */
.quick-action-btn {
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.12s;
    white-space: nowrap;
    line-height: 1.4;
    min-height: 30px;
    -webkit-tap-highlight-color: transparent;
}
.quick-action-btn:active { transform: scale(0.94); }

/* Snooze picker */
.snooze-picker {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
    animation: fadeIn 0.15s ease;
}
.snooze-picker.visible { display: flex; }

/* Expanded detail sections */
.client-detail-section {
    background: #f8fafc;
    border-radius: 0.6rem;
    padding: 0.75rem;
}

/* Action group separator */
.action-sep {
    display: inline-block;
    width: 1px;
    height: 20px;
    background: #e5e7eb;
    margin: 0 2px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Chevron transition */
.chevron { display: inline-block; transition: transform 0.2s ease; }

/* Tab buttons */
.tab-btn { user-select: none; -webkit-tap-highlight-color: transparent; }

/* Mobile Optimizations */
@media (max-width: 640px) {
    .mobile-full-width {
        width: 100%;
    }
    
    .mobile-text-center {
        text-align: center;
    }
    
    .mobile-hidden {
        display: none;
    }
    
    .mobile-stack {
        flex-direction: column;
    }
    
    .mobile-gap-2 > * + * {
        margin-top: 0.5rem;
    }
}
