/* Beautiful Customer Management Enhancements */

/* Customers Header */
.customers-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.customers-header h2 {
    color: #2c3e50;
    margin: 0;
}

/* Page Header Styling */
.page-header {
    background: white;
    color: #2c3e50;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border-bottom: 2px solid #e0e0e0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.title-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c3e50;
}

.title-section h2 i {
    font-size: 2rem;
    color: #3498db;
}

.page-subtitle {
    margin: 0;
    color: #7f8c8d;
    font-size: 1rem;
}

.customers-header .header-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 1rem;
}

.customers-header .filter-controls {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 0.75rem;
}

.customers-header .action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.customers-header .action-buttons .btn-primary,
.customers-header .action-buttons .btn-secondary,
.customers-header .action-buttons button,
.customers-header .action-buttons a {
    width: 100%;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.customers-header .action-buttons .btn-primary:hover {
    background-color: #2980b9;
}

/* Statistics Cards */
.stats-section {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    font-size: 1.3rem;
}

.stat-content h3 {
    margin: 0 0 0.5rem 0;
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: 400;
}

.stat-content h2 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.6rem;
    font-weight: 700;
}

.stat-change {
    font-size: 0.8rem;
    color: #27ae60;
}

.stat-subtitle {
    font-size: 0.8rem;
    color: #95a5a6;
}

/* Search and Filter Controls */
.controls-section {
    margin-bottom: 2rem;
}

.search-filter-bar {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: #6c757d;
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 0.5rem 0.5rem 2.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
    background: white;
}

.search-box input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.filter-controls {
    display: flex;
    gap: 1rem;
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    color: #2c3e50;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filter-select:focus {
    border-color: #3498db;
    background: white;
}

/* Table Section */
.table-section,
.customers-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    padding: 1.5rem;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.table-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: #3498db;
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-icon:hover {
    background: #2980b9;
}

.table-container,
.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    height: 35vh;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

/* Enhanced Table Styling */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.modern-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.th-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.th-content i {
    font-size: 1.125rem;
    opacity: 0.7;
}

.modern-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

.modern-table tr:hover {
    background: #f8f9fa;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-action {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
}

.btn-action.edit {
    background: #3498db;
    color: white;
}

.btn-action.edit:hover {
    background: #2980b9;
}

.btn-action.view {
    background: #27ae60;
    color: white;
}

.btn-action.view:hover {
    background: #229954;
}

.btn-action.delete {
    background: #e74c3c;
    color: white;
}

.btn-action.delete:hover {
    background: #c0392b;
}

/* Enhanced Modal Styling */
.enhanced-modal {
    max-width: 800px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.modal-subtitle {
    margin: 0.25rem 0 0 0;
    color: #7f8c8d;
    font-size: 0.875rem;
    font-weight: 400;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #ecf0f1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #7f8c8d;
}

.modal-close:hover {
    background: #bdc3c7;
    color: #2c3e50;
}

/* Loading and Empty States */
.loading-state,
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #7f8c8d;
}

.loading-state div,
.empty-state div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-state i,
.empty-state i {
    font-size: 3rem;
    color: #bdc3c7;
}

.loading-state h3,
.empty-state h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.loading-state p,
.empty-state p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.loading-state i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.form-section:nth-child(odd) {
    background: #fff;
    border-left-color: #f093fb;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.section-header i {
    font-size: 1.5rem;
    color: #667eea;
}

.section-header h4 {
    margin: 0;
    color: #495057;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Enhanced Form Controls */
.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
}

.form-group label i {
    font-size: 1rem;
    color: #6c757d;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Enhanced Footer */
.enhanced-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.875rem;
}

.footer-info i {
    font-size: 1rem;
}

.footer-actions {
    display: flex;
    gap: 1rem;
}

.footer-actions .btn-primary,
.footer-actions .btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .customers-header {
        gap: 5vw;
    }

    .customers-header .header-actions {
        gap: 4vw;
    }

    .customers-header .action-buttons {
        gap: 4vw;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 5vw;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 4vw;
    }

    .search-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 4vw;
    }

    .search-box {
        min-width: unset;
        width: 100%;
        padding: 3.2vw 3.2vw 3.2vw 9vw;
        font-size: 3.8vw;
    }

    .filter-controls {
        justify-content: stretch;
        gap: 3vw;
    }

    .filter-select {
        flex: 1;
        padding: 3vw 4vw;
        border-radius: 2.5vw;
        font-size: 3.6vw;
    }

    .table-header {
        flex-direction: column;
        gap: 4vw;
        text-align: center;
    }

    .enhanced-footer {
        flex-direction: column;
        gap: 4vw;
        text-align: center;
    }
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.empty-state p {
    margin-bottom: 2rem;
}

/* Table Cell Enhancements */
.customer-id,
.customer-info,
.owner-info,
.contact-info,
.email-info,
.location-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.customer-id i,
.owner-info i,
.contact-info i,
.email-info i,
.location-info i {
    font-size: 1rem;
    color: #6c757d;
    opacity: 0.7;
}

.customer-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.customer-info strong {
    color: #495057;
    font-weight: 600;
}

.customer-info small {
    color: #6c757d;
    font-size: 0.75rem;
    font-style: italic;
}

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

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

/* Enhanced Notifications */
.enhanced-notification {
    border-left: 4px solid rgba(255, 255, 255, 0.3);
}

.enhanced-notification i {
    font-size: 1.25rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Compact Table View */
.modern-table.compact-view td {
    padding: 0.5rem;
    font-size: 0.8rem;
}

.modern-table.compact-view .customer-info,
.modern-table.compact-view .owner-info,
.modern-table.compact-view .contact-info,
.modern-table.compact-view .email-info,
.modern-table.compact-view .location-info {
    gap: 0.25rem;
}

.modern-table.compact-view .customer-info small {
    display: none;
}

/* Hover Effects */
.stat-card:hover .stat-icon {
    transform: rotate(5deg) scale(1.05);
}

.btn-action:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Focus States */
.search-box input:focus {
    transform: scale(1.02);
}

.filter-select:focus {
    transform: translateY(-1px);
}

/* Loading Animation for Table */
.loading-table-row {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    height: 60px;
}

/* Success States */
.form-group input:valid {
    border-color: #28a745;
}

.form-group input:invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Micro-interactions */
.btn-primary:active {
    transform: scale(0.98);
}

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

.btn-action:active {
    transform: scale(0.9);
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .page-header {
        background: linear-gradient(135deg, #4c51bf 0%, #553c9a 100%);
    }

    .stat-card {
        background: #2d3748;
        color: white;
    }

    .search-filter-bar {
        background: #2d3748;
    }

    .table-section {
        background: #2d3748;
    }

    .modern-table th {
        background: #1a202c;
        color: white;
    }

    .modern-table td {
        border-bottom-color: #4a5568;
        color: white;
    }

    .enhanced-modal {
        background: #2d3748;
        color: white;
    }
}
