/* Account Settings Styles */

:root {
    --primary-blue: #2563eb;
    --dark-blue: #1e40af;
    --light-blue: #3b82f6;
    --accent-blue: #60a5fa;
    --success-green: #10b981;
    --warning-yellow: #f59e0b;
    --error-red: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

/* Layout */
.settings-container {
    display: flex;
    min-height: calc(100vh - 80px);
    margin-top: 80px;
    background-color: var(--gray-50);
}

/* Sidebar */
.settings-sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--gray-200);
    padding: 2rem 0;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.user-info {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    text-align: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
    font-weight: bold;
}

.user-info h3 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    color: var(--gray-900);
}

.user-info p {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.user-role {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--gray-100);
    color: var(--gray-700);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.user-role.owner {
    background-color: #dbeafe;
    color: var(--primary-blue);
}

/* Settings Navigation */
.settings-nav {
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.settings-nav-item:hover {
    background-color: var(--gray-50);
    color: var(--primary-blue);
}

.settings-nav-item.active {
    background-color: #eff6ff;
    color: var(--primary-blue);
    border-left-color: var(--primary-blue);
    font-weight: 600;
}

.settings-nav-item .icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

/* Main Content */
.settings-main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
}

.settings-section {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.settings-section.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    color: var(--gray-900);
}

.section-header p {
    margin: 0;
    color: var(--gray-600);
    font-size: 1rem;
}

/* Settings Card */
.settings-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.settings-card h3 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    color: var(--gray-900);
}

.settings-card h4 {
    margin: 1.5rem 0 1rem;
    font-size: 1.125rem;
    color: var(--gray-900);
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input:disabled {
    background-color: var(--gray-100);
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--gray-500);
    font-size: 0.75rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--dark-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background-color: var(--gray-300);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

.btn-outline:hover {
    background-color: var(--primary-blue);
    color: white;
}

.btn-danger {
    background-color: var(--error-red);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-link {
    background: none;
    color: var(--primary-blue);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-link:hover {
    text-decoration: underline;
}

.sign-out-btn {
    color: var(--error-red) !important;
    font-weight: 600;
}

.sign-out-btn:hover {
    background-color: #fee2e2;
    border-radius: 4px;
}

/* Subscription Card */
.subscription-card {
    border: 2px solid var(--primary-blue);
}

.subscription-details {
    margin: 2rem 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--gray-700);
}

.detail-value {
    color: var(--gray-900);
    font-weight: 500;
}

.credits-bar {
    width: 200px;
    height: 8px;
    background-color: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.credits-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-blue));
    transition: width 0.3s;
}

/* Resources Card */
.resources-card {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.resource-item:last-child {
    margin-bottom: 0;
}

.resource-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.resource-item p {
    margin: 0;
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Users Section */
.users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.users-info h3 {
    margin: 0 0 0.25rem;
}

.users-info p {
    margin: 0;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.users-table-container {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    text-align: left;
    padding: 1rem;
    background-color: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
}

.users-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-900);
}

.users-table tr:hover {
    background-color: var(--gray-50);
}

.loading-row {
    text-align: center;
    color: var(--gray-500);
    font-style: italic;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.invited {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.suspended {
    background-color: #fee2e2;
    color: #991b1b;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-badge.owner {
    background-color: #dbeafe;
    color: var(--primary-blue);
}

.role-badge.member {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-600);
    font-size: 1.25rem;
    transition: all 0.2s;
}

.action-btn:hover {
    color: var(--primary-blue);
}

.action-btn.delete:hover {
    color: var(--error-red);
}

/* Invitations List */
.invitations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.invitation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--gray-50);
    border-radius: 8px;
    border-left: 4px solid var(--warning-yellow);
}

.invitation-info {
    flex: 1;
}

.invitation-email {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.invitation-date {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.invitation-actions {
    display: flex;
    gap: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-large {
    max-width: 1200px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background-color: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: 2rem;
}

/* Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.plan-card {
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
    position: relative;
}

.plan-card:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.1);
    transform: translateY(-4px);
}

.plan-card.popular {
    border-color: var(--primary-blue);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.plan-header h3 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    color: var(--gray-900);
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.price-period {
    font-size: 1rem;
    color: var(--gray-600);
    margin-left: 0.25rem;
}

.plan-features {
    margin-bottom: 1.5rem;
}

.feature {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    color: var(--gray-700);
}

.feature-icon {
    color: var(--success-green);
    margin-right: 0.5rem;
    font-weight: bold;
}

.select-plan-btn {
    width: 100%;
}

/* Checkout Summary */
.checkout-summary {
    background-color: var(--gray-50);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.checkout-summary h3 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.summary-row.total {
    border-bottom: none;
    border-top: 2px solid var(--gray-300);
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.125rem;
}

.checkout-info {
    padding: 1rem;
    background-color: #eff6ff;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.checkout-info p {
    margin: 0.5rem 0;
    color: var(--gray-700);
}

/* Notification Toast */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: none;
    align-items: center;
    gap: 0.75rem;
    z-index: 1001;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}

.notification.show {
    display: flex;
}

.notification.success {
    border-left: 4px solid var(--success-green);
}

.notification.error {
    border-left: 4px solid var(--error-red);
}

.notification.warning {
    border-left: 4px solid var(--warning-yellow);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .settings-sidebar {
        width: 240px;
    }
    
    .plans-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .settings-container {
        flex-direction: column;
    }
    
    .settings-sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }
    
    .settings-main {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .users-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .users-table-container {
        overflow-x: scroll;
    }
    
    .resource-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .settings-main {
        padding: 0.5rem;
    }
    
    .settings-card {
        padding: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}