/* User Profile Styles */

.profile-container {
    width: 100%;
    margin: 0;
    padding: 2rem;
}

/* Tabs */
.profile-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border, #333);
}

.profile-tab {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary, #b3b3b3);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.profile-tab:hover {
    color: var(--text-primary, #fff);
    background: rgba(255, 255, 255, 0.05);
}

.profile-tab.active {
    color: var(--accent-blue, #2196f3);
    border-bottom-color: var(--accent-blue, #2196f3);
}

.tab-icon {
    width: 20px;
    height: 20px;
}

.profile-header {
    margin-bottom: 2rem;
}

.profile-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 0 0 0.5rem 0;
}

.profile-subtitle {
    font-size: 1rem;
    color: var(--text-secondary, #b3b3b3);
    margin: 0;
}

.profile-loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.1rem;
    color: var(--text-secondary, #b3b3b3);
}

/* Alert Messages */
.profile-alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.profile-alert-error {
    background: rgba(247, 63, 49, 0.1);
    border: 1px solid rgba(247, 63, 49, 0.3);
    color: #f73f31;
}

.profile-alert-success {
    background: rgba(81, 207, 102, 0.1);
    border: 1px solid rgba(81, 207, 102, 0.3);
    color: #51cf66;
}

/* Profile Cards */
.profile-card {
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border, #333);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.profile-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border, #333);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-card-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin: 0;
}

.profile-card-body {
    padding: 1.5rem;
}

.profile-actions {
    display: flex;
    gap: 0.75rem;
}

/* Badges */
.profile-badge {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-badge-success {
    background: rgba(81, 207, 102, 0.15);
    color: #51cf66;
    border: 1px solid rgba(81, 207, 102, 0.3);
}

.profile-badge-warning {
    background: rgba(255, 159, 64, 0.15);
    color: #ff9f40;
    border: 1px solid rgba(255, 159, 64, 0.3);
}

/* Info Display (View Mode) */
.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-info-item label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary, #b3b3b3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-info-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.profile-info-message {
    padding: 1rem;
    background: var(--bg-tertiary, #2a2a2a);
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary, #b3b3b3);
}

.profile-info-success {
    background: rgba(81, 207, 102, 0.1);
    border: 1px solid rgba(81, 207, 102, 0.2);
    color: #51cf66;
}

.profile-actions-bottom {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border, #333);
}

/* Form Styles */
.profile-form {
    width: 100%;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.profile-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-form-group-full {
    grid-column: 1 / -1;
}

.profile-form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary, #fff);
}

.profile-form-group label .required {
    color: #f73f31;
    margin-left: 0.2rem;
}

.profile-form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border, #333);
    border-radius: 6px;
    background: var(--bg-tertiary, #2a2a2a);
    color: var(--text-primary, #fff);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-form-control:focus {
    outline: none;
    border-color: var(--accent-blue, #2196f3);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.profile-form-control::placeholder {
    color: var(--text-tertiary, #666);
}

.profile-form-hint {
    font-size: 0.85rem;
    color: var(--text-secondary, #b3b3b3);
    font-style: italic;
}

.profile-form-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, #333);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--accent-blue, #2196f3);
    color: white;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: #1976d2;
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.4);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-tertiary, #2a2a2a);
    color: var(--text-primary, #fff);
    border: 1px solid var(--border, #333);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-fourth, #3a3a3a);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(247, 63, 49, 0.1);
    color: #f73f31;
    border: 1px solid rgba(247, 63, 49, 0.3);
}

.btn-danger:hover {
    background: rgba(247, 63, 49, 0.2);
    border-color: rgba(247, 63, 49, 0.5);
    transform: translateY(-1px);
}

/* Sessions Table */
.sessions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.sessions-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--border, #333);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary, #b3b3b3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sessions-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border, #333);
    font-size: 0.95rem;
    color: var(--text-primary, #fff);
}

.sessions-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* RDI Grid */
.rdi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.rdi-item {
    background: var(--bg-tertiary, #2a2a2a);
    border: 1px solid var(--border, #333);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.rdi-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rdi-item-large {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1) 0%, rgba(81, 207, 102, 0.1) 100%);
    border-color: var(--accent-blue, #2196f3);
}

.rdi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin-bottom: 0.3rem;
}

.rdi-item-large .rdi-value {
    font-size: 2.5rem;
    color: var(--accent-blue, #2196f3);
}

.rdi-label {
    font-size: 0.85rem;
    color: var(--text-secondary, #b3b3b3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-container {
        padding: 1rem;
    }

    .profile-header h1 {
        font-size: 1.5rem;
    }

    .profile-tabs {
        flex-wrap: wrap;
    }

    .profile-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .profile-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .profile-form-grid {
        grid-template-columns: 1fr;
    }

    .profile-form-group-full {
        grid-column: 1;
    }

    .profile-form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

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

    .rdi-item-large {
        grid-column: 1 / -1;
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
    }

    .profile-actions-bottom {
        justify-content: stretch;
    }

    .profile-actions-bottom .btn {
        width: 100%;
    }

    .sessions-table {
        font-size: 0.85rem;
    }

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

    .sessions-table th:nth-child(2),
    .sessions-table td:nth-child(2) {
        display: none; /* Hide IP address on mobile */
    }
}
