/* ==========================================
   SUBSCRIPTION PLANS ADMIN STYLES
   ========================================== */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0c71c3 0%, #15314e 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.plans-management-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.header-title {
    display: flex;
    flex-direction: column;
}

.page-header h1 {
    font-size: 1.25rem;
    color: #333;
    margin: 0;
}

.header-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0.5rem 0 0 0;
    font-weight: 400;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #666;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #f9f9f9;
}

.back-link {
    color: #0c71c3;
    text-decoration: none;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.back-link:hover {
    background: rgba(12, 113, 195, 0.1);
}

.plans-content {
    background: white;
    border-radius: 12px;
    padding: 1.5rem 2rem 2rem 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 600px;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.plan-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.plan-card.inactive {
    opacity: 0.6;
    background: #fafafa;
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.plan-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
}

.plan-code {
    font-size: 0.75rem;
    color: #6b7280;
    font-family: 'Courier New', monospace;
    background: #e5e7eb;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.plan-status {
    padding: 0.3rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

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

.plan-pricing {
    margin: 1rem 0;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.price-row:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
}

.price-label {
    color: #6b7280;
    font-size: 0.9rem;
}

.price-value {
    font-weight: 700;
    color: #0c71c3;
    font-size: 1.1rem;
}

.plan-limits {
    margin: 1rem 0;
}

.limit-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #f3f4f6;
}

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

.plan-features {
    margin: 1rem 0 0 0;
}

.features-label {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 6px;
    font-size: 0.75rem;
    margin: 0.25rem 0.25rem 0.25rem 0;
}

.plan-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.btn-sm {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    flex: 1;
}

.btn-edit {
    background: #3b82f6;
    color: white;
}

.btn-edit:hover {
    background: #2563eb;
}

.btn-toggle {
    background: #f59e0b;
    color: white;
}

.btn-toggle:hover {
    background: #d97706;
}

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

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

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

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

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

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

.form-group small {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.features-checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-item label {
    margin: 0 !important;
    font-weight: normal !important;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}
