/* Frontend Dashboard Styles for Dental Gift Cards */

/* Hide WordPress admin bar and elements on standalone dashboard */
.dgc-dashboard-standalone #wpadminbar,
.dgc-dashboard-standalone .admin-bar,
body.dgc-dashboard-standalone #wpadminbar {
    display: none !important;
    height: 0 !important;
    position: absolute !important;
    visibility: hidden !important;
}

body.dgc-dashboard-standalone {
    margin: 0 !important;
    padding: 0 !important;
    background: #f5f5f5 !important;
}

.dgc-dashboard-wrap {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header */
.dgc-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.dgc-dashboard-header h1 {
    margin: 0;
    font-size: 32px;
    color: #1f2937;
}

/* Buttons */
.dgc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.dgc-btn-primary {
    background: #3b82f6;
    color: #ffffff;
}

.dgc-btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.dgc-btn-secondary {
    background: #6b7280;
    color: #ffffff;
}

.dgc-btn-secondary:hover {
    background: #4b5563;
}

.dgc-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dgc-btn-icon:hover {
    background: #3b82f6;
    color: #ffffff;
    transform: scale(1.1);
}

/* Statistics Grid */
.dgc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.dgc-stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dgc-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dgc-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.dgc-stat-icon-blue {
    background: #dbeafe;
    color: #3b82f6;
}

.dgc-stat-icon-yellow {
    background: #fef3c7;
    color: #f59e0b;
}

.dgc-stat-icon-green {
    background: #d1fae5;
    color: #10b981;
}

.dgc-stat-icon-purple {
    background: #e9d5ff;
    color: #a855f7;
}

.dgc-stat-content {
    flex: 1;
}

.dgc-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 4px;
}

.dgc-stat-label {
    font-size: 14px;
    color: #6b7280;
}

/* Table Container */
.dgc-table-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

.dgc-table-header h2 {
    margin: 0;
    font-size: 20px;
    color: #1f2937;
}

.dgc-search-input {
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    width: 300px;
    transition: border-color 0.2s ease;
}

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

/* Table */
.dgc-table {
    width: 100%;
    border-collapse: collapse;
}

.dgc-table thead {
    background: #f9fafb;
}

.dgc-table th {
    padding: 16px 24px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dgc-table td {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    color: #1f2937;
}

.dgc-table tbody tr {
    transition: background-color 0.2s ease;
}

.dgc-table tbody tr:hover {
    background: #f9fafb;
}

/* Table Elements */
.dgc-code {
    background: #f3f4f6;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #3b82f6;
}

.dgc-beneficiary-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dgc-beneficiary-info strong {
    color: #1f2937;
    font-size: 15px;
}

.dgc-beneficiary-info small {
    color: #6b7280;
    font-size: 13px;
}

.dgc-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-sent {
    background: #dbeafe;
    color: #1e40af;
}

.status-used {
    background: #d1fae5;
    color: #065f46;
}

.status-expired {
    background: #fee2e2;
    color: #991b1b;
}

.dgc-actions {
    display: flex;
    gap: 8px;
}

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

.dgc-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dgc-modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dgc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.dgc-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #1f2937;
}

.dgc-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #6b7280;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.dgc-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* Form */
.dgc-modal-content form {
    padding: 24px;
}

.dgc-form-group {
    margin-bottom: 20px;
}

.dgc-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.dgc-form-group input[type="text"],
.dgc-form-group input[type="email"],
.dgc-form-group input[type="tel"],
.dgc-form-group select,
.dgc-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.dgc-form-group input:focus,
.dgc-form-group select:focus,
.dgc-form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dgc-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.dgc-form-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.dgc-form-actions .dgc-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

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

.dgc-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #f3f4f6;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .dgc-dashboard-header {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .dgc-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dgc-table-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .dgc-search-input {
        width: 100%;
    }
    
    .dgc-table {
        font-size: 14px;
    }
    
    .dgc-table th,
    .dgc-table td {
        padding: 12px 16px;
    }
    
    .dgc-modal-content {
        width: 95%;
        margin: 20px;
    }
}
