/* ===================================================================
   ARCHIVE - CELLULAR VIEW STYLES
   A phone-number/company focused view for archived transactions
   =================================================================== */

/* View Toggle Navigation */
.archive-view-toggle-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    border: 1px solid #cbd5e0;
}

.archive-view-toggle-bar .view-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #cbd5e0;
    background: white;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.archive-view-toggle-bar .view-btn:hover {
    background: #edf2f7;
    border-color: #a0aec0;
    transform: translateY(-1px);
}

.archive-view-toggle-bar .view-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.archive-view-toggle-bar .view-btn.active:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.archive-view-toggle-bar .view-btn i {
    font-size: 1em;
}

/* Stats Row in View Toggle */
.archive-view-stats-row {
    display: flex;
    gap: 16px;
    margin-left: auto;
}

.archive-view-stat-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.archive-view-stat-mini i {
    font-size: 1.1em;
}

.archive-view-stat-mini .stat-content {
    display: flex;
    flex-direction: column;
}

.archive-view-stat-mini .stat-number {
    font-weight: 700;
    font-size: 1.1em;
    color: #2d3748;
    line-height: 1;
}

.archive-view-stat-mini .stat-label {
    font-size: 0.7em;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cellular View Container */
.archive-cellular-view-container {
    display: none;
    padding: 0;
    background: white;
}

.archive-cellular-view-container.active {
    display: block;
}

/* Cellular View Header - Clean/No background */
.archive-cellular-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: white;
    border-radius: 12px 12px 0 0;
    border: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.archive-cellular-search {
    position: relative;
    flex: 0 1 400px;
}

.archive-cellular-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 1em;
}

.archive-cellular-search input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    font-size: 1em;
    background: white;
    transition: all 0.3s ease;
}

.archive-cellular-search input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.archive-cellular-search input::placeholder {
    color: #9ca3af;
}

.archive-cellular-stats {
    display: flex;
    gap: 20px;
}

.archive-cellular-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    font-weight: 600;
}

.archive-cellular-stat .stat-count {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* Date Range Filter */
.archive-cellular-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-weight: 500;
    font-size: 0.9em;
}

.archive-cellular-date-range label {
    color: #64748b;
}

.archive-cellular-date-range input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.9em;
    color: #334155;
    background: white;
    cursor: pointer;
}

.archive-cellular-date-range input[type="date"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.archive-cellular-date-range span {
    color: #94a3b8;
}

/* Date Range Clear Button */
.archive-date-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.archive-date-clear-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.archive-date-clear-btn i {
    font-size: 0.8em;
}

/* Search match highlight */
.search-highlight {
    background-color: #fef08a;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* Cellular View Content */
.archive-cellular-view-content {
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Transaction Card Styling - Contact Directory Format */
.archive-phone-card {
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
    background: white;
    overflow: hidden;
}

.archive-phone-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Header Row - Inline fields like contact-directory */
.archive-card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
}

.archive-header-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.archive-header-field {
    font-size: 14px;
    color: #374151;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.archive-header-field strong {
    color: #111827;
    font-weight: 700;
}

.archive-header-field .expense {
    color: #dc2626;
    font-weight: 600;
}

.archive-header-field .income {
    color: #16a34a;
    font-weight: 600;
}

.archive-header-right {
    display: flex;
    gap: 8px;
}

/* Category text colors */
.archive-category-text.business {
    color: #1e40af;
    font-weight: 600;
}

.archive-category-text.personal {
    color: #9d174d;
    font-weight: 600;
}

/* Details List - Vertical format like contact-directory */
.archive-card-details-list {
    padding: 10px 20px;
    background: white;
}

/* Three-column layout for details */
.archive-details-columns {
    display: flex;
    gap: 30px;
}

.archive-details-left {
    flex: 1.5;
}

.archive-details-middle {
    flex: 1;
}

.archive-details-right {
    flex: 0.8;
}

.archive-detail-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.archive-detail-row:last-child {
    border-bottom: none;
}

.archive-detail-label {
    font-weight: 600;
    color: #374151;
    min-width: 140px;
    flex-shrink: 0;
    font-size: 13px;
}

.archive-detail-value {
    color: #4b5563;
    flex: 1;
    font-size: 13px;
}

/* Icon styling */
.archive-phone-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.archive-phone-icon-wrapper.expense {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.archive-phone-icon-wrapper.income {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
}

.archive-phone-icon-wrapper i {
    font-size: 1em;
}

/* Action Buttons */
.archive-phone-action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.archive-phone-action-btn.view-btn {
    background: #e0f2fe;
    color: #0369a1;
}

.archive-phone-action-btn.view-btn:hover {
    background: #bae6fd;
}

.archive-phone-action-btn.edit-btn {
    background: #1d4ed8;
    color: white;
}

.archive-phone-action-btn.edit-btn:hover {
    background: #1e40af;
}

/* Empty State */
.archive-cellular-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.archive-cellular-empty-state i {
    font-size: 4em;
    color: #cbd5e0;
    margin-bottom: 20px;
}

.archive-cellular-empty-state h3 {
    margin-bottom: 10px;
    color: #475569;
}

.archive-cellular-empty-state p {
    font-size: 0.95em;
}

/* Loading State */
.archive-cellular-loading {
    text-align: center;
    padding: 60px 20px;
}

.archive-cellular-loading .loading-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 3px solid rgba(34, 197, 94, 0.3);
    border-radius: 50%;
    border-top-color: #22c55e;
    animation: spin 1s ease-in-out infinite;
}

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

/* Scrollbar Styling */
.archive-cellular-view-content::-webkit-scrollbar {
    width: 8px;
}

.archive-cellular-view-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.archive-cellular-view-content::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

.archive-cellular-view-content::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Workflow card for 6 items - smaller sizing */
.workflow-steps-v2.six-items {
    grid-template-columns: repeat(6, 1fr);
}

.workflow-steps-v2.six-items .workflow-card {
    padding: 20px 12px 15px 12px;
}

.workflow-steps-v2.six-items .workflow-card h4 {
    font-size: 14px;
}

.workflow-steps-v2.six-items .workflow-description {
    font-size: 12px;
    min-height: 45px;
    padding: 8px 6px;
}

.workflow-steps-v2.six-items .workflow-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

/* Cellular View workflow card special styling */
.workflow-card.cellular-view-card {
    background: linear-gradient(135deg, #bbf7d0 0%, #86efac 100%);
}

.workflow-card.cellular-view-card .workflow-icon i {
    color: #166534;
}

/* Section highlight animation (matches workflow-navigation-v2) */
.section-highlight-active {
    animation: sectionHighlight 3s ease-out;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.5) !important;
    border-color: #10b981 !important;
}

@keyframes sectionHighlight {
    0% {
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.8);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .workflow-steps-v2.six-items {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .archive-view-toggle-bar {
        flex-wrap: wrap;
    }
    
    .archive-view-stats-row {
        width: 100%;
        margin-left: 0;
        margin-top: 12px;
        justify-content: center;
    }
    
    .archive-cellular-view-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .archive-cellular-search {
        width: 100%;
        flex: none;
    }
    
    .archive-cellular-date-range {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .archive-card-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .archive-header-left {
        width: 100%;
    }
    
    .archive-header-right {
        width: 100%;
        justify-content: flex-end;
    }
    
    .archive-detail-label {
        min-width: 120px;
    }
    
    .archive-details-columns {
        flex-direction: column;
        gap: 0;
    }
    
    .workflow-steps-v2.six-items {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .archive-view-toggle-bar .view-btn {
        padding: 8px 14px;
        font-size: 0.85em;
    }
    
    .archive-view-toggle-bar .view-btn span {
        display: none;
    }
    
    .archive-header-field {
        font-size: 0.85em;
    }
    
    .archive-detail-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .archive-detail-label {
        min-width: unset;
    }
    
    .workflow-steps-v2.six-items {
        grid-template-columns: 1fr;
    }
}
