/* Invite Manager Styles */

.invite-manager {
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.invite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.invite-header h3 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

.invite-actions {
    display: flex;
    gap: 10px;
}

/* Statistics Cards */
.invite-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 13px;
    opacity: 0.9;
}

/* Filters */
.invite-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input,
.filter-select {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-input {
    flex: 1;
    min-width: 250px;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-select {
    min-width: 180px;
}

/* Table */
.invite-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.invite-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.invite-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.invite-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

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

.invite-table .loading,
.invite-table .empty,
.invite-table .error {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.invite-table .error {
    color: #dc3545;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-created { background: #e9ecef; color: #495057; }
.status-badge.status-sent { background: #cfe2ff; color: #084298; }
.status-badge.status-delivered { background: #d1e7dd; color: #0f5132; }
.status-badge.status-opened { background: #fff3cd; color: #997404; }
.status-badge.status-clicked { background: #cff4fc; color: #055160; }
.status-badge.status-active { background: #d1e7dd; color: #0a3622; }
.status-badge.status-exhausted { background: #f8d7da; color: #842029; }
.status-badge.status-disabled { background: #343a40; color: #fff; }

/* Quota Badge and Bar */
.quota-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #e9ecef;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

.quota-bar {
    width: 80px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.quota-fill {
    height: 100%;
    background: #28a745;
    transition: width 0.3s;
}

.quota-bar.high .quota-fill { background: #ffc107; }
.quota-bar.full .quota-fill { background: #dc3545; }

/* Action Buttons */
.actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: #e9ecef;
}

/* Bulk Actions */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 15px;
}

.selected-count {
    font-weight: 600;
    color: #495057;
    margin-right: auto;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6c757d;
    line-height: 1;
}

.close-btn:hover {
    color: #dc3545;
}

.modal-body {
    padding: 20px;
}

/* Modal form elements */
.modal h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #212529;
}

.modal label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.modal input[type="email"],
.modal input[type="text"],
.modal textarea,
.modal select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

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

.modal iframe {
    width: 100%;
    height: 500px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}

.import-instructions {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.import-instructions pre {
    background: #e9ecef;
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 13px;
}

.import-instructions code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

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

.text-input,
.number-input,
.file-input,
.textarea-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
}

.text-input:focus,
.number-input:focus,
.file-input:focus,
.textarea-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.textarea-input {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Progress */
.import-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

#progressText {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

/* Results */
.import-results {
    margin-top: 20px;
}

.results-summary {
    padding: 15px;
    border-radius: 8px;
}

.results-summary.success {
    background: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
}

.results-summary.warning {
    background: #fff3cd;
    border: 1px solid #ffe69c;
    color: #997404;
}

.results-summary h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.error-list {
    max-height: 200px;
    overflow-y: auto;
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.error-list li {
    margin: 5px 0;
    font-size: 13px;
}

details summary {
    cursor: pointer;
    font-weight: 600;
    margin: 10px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .invite-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

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

    .invite-filters {
        flex-direction: column;
    }

    .search-input,
    .filter-select {
        width: 100%;
    }

    .invite-table {
        font-size: 12px;
    }

    .invite-table th,
    .invite-table td {
        padding: 8px;
    }

    .bulk-actions {
        flex-wrap: wrap;
    }

    .modal-content {
        width: 95%;
    }
}

/* AG-Grid custom styles */
.ag-theme-alpine {
    --ag-header-height: 48px;
    --ag-row-height: 54px;
    --ag-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Action buttons in grid cells */
.ag-theme-alpine .actions {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
}

.ag-theme-alpine .actions .btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.ag-theme-alpine .actions .btn-icon:hover {
    background: #e9ecef;
}

/* Status badges in grid */
.ag-theme-alpine .ag-cell .status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

/* Quota display in grid */
.ag-theme-alpine .ag-cell .quota-badge {
    font-size: 12px;
    color: #666;
    margin-right: 8px;
    display: inline-block;
}

.ag-theme-alpine .ag-cell .quota-bar {
    width: 80px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    display: inline-block;
    vertical-align: middle;
    overflow: hidden;
}

.ag-theme-alpine .ag-cell .quota-fill {
    height: 100%;
    transition: width 0.3s;
}
