/* Admin Page Styles */

/* Login Page */
.login-section {
    min-height: 100vh;
    padding: 120px 20px 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-color);
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.login-card h1 {
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.login-card > p {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.google-btn-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    min-height: 50px;
}

.google-btn-wrapper iframe {
    margin: 0 auto;
}

.login-hint {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 1rem;
}

.login-error {
    color: #c62828;
    font-size: 0.9rem;
    margin-top: 1rem;
    min-height: 1.5em;
}

.login-error code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Admin header with user */
.admin-header-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-email {
    font-size: 0.9rem;
    color: var(--text-light);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    padding: 8px 20px;
    font-size: 0.95rem;
}

.admin-section {
    padding: 120px 0 80px;
    background: var(--light-color);
    min-height: 100vh;
}

.admin-header {
    text-align: center;
    margin-bottom: 3rem;
}

.admin-header h1 {
    font-size: 2.5rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.admin-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Admin Controls */
.admin-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.filter-box {
    display: flex;
    gap: 0.5rem;
}

.filter-box select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-box select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Enquiries Table */
.enquiries-table-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.enquiries-table {
    width: 100%;
    border-collapse: collapse;
}

.enquiries-table thead {
    background: var(--light-color);
}

.enquiries-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid #e0e0e0;
}

.enquiries-table td {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-color);
}

.enquiries-table tbody tr:hover {
    background: var(--light-color);
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-new {
    background: #e3f2fd;
    color: #1976d2;
}

.status-contacted {
    background: #fff3e0;
    color: #f57c00;
}

.status-quoted {
    background: #f3e5f5;
    color: #7b1fa2;
}

.status-completed {
    background: #e8f5e9;
    color: #388e3c;
}

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

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-view {
    background: #2196f3;
    color: white;
}

.btn-view:hover {
    background: #1976d2;
}

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

.btn-delete:hover {
    background: #d32f2f;
}

.no-enquiries {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--dark-color);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.enquiry-detail-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.enquiry-detail-item:last-child {
    border-bottom: none;
}

.enquiry-detail-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
    display: block;
}

.enquiry-detail-value {
    color: var(--text-light);
}

.enquiry-detail-value a {
    color: var(--secondary-color);
    text-decoration: none;
}

.enquiry-detail-value a:hover {
    text-decoration: underline;
}

.status-select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.status-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-controls {
        flex-direction: column;
    }

    .filter-box {
        flex-direction: column;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .enquiries-table-container {
        padding: 1rem;
    }

    .enquiries-table {
        font-size: 0.9rem;
    }

    .enquiries-table th,
    .enquiries-table td {
        padding: 0.75rem 0.5rem;
    }

    .action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .admin-header h1 {
        font-size: 2rem;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .enquiries-table {
        font-size: 0.8rem;
    }

    .modal-content {
        padding: 1.5rem;
        margin: 10% auto;
    }
}
