/* Settings Page Styles */
.settings-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

.settings-header {
    margin-bottom: 40px;
}

.settings-header h1 {
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 8px;
}

.settings-header p {
    color: var(--gray);
    font-size: 1.1rem;
}

.settings-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

.settings-sidebar {
    background: white;
    border-radius: 16px;
    padding: 30px 0;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--gray);
    font-family: var(--font-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.nav-item i {
    width: 20px;
    font-size: 1.1rem;
}

.nav-item:hover {
    background: var(--light);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid var(--light-gray);
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: var(--danger);
    font-family: var(--font-primary);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

.settings-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.settings-section {
    display: none;
}

.settings-section.active {
    display: block;
}

.settings-section h2 {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--light-gray);
}

/* Profile Section */
.profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
}

.avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    background: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 3rem;
    overflow: hidden;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-upload {
    padding: 8px 16px;
    background: var(--light);
    border: 1px solid var(--light-gray);
    border-radius: 6px;
    color: var(--dark);
    font-family: var(--font-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-upload:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

.profile-info h3 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 8px;
}

.profile-info p {
    color: var(--gray);
}

.settings-form {
    max-width: 600px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    color: var(--dark);
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.email-status,
.phone-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.9rem;
}

.email-status i {
    color: var(--success);
}

.phone-status i {
    color: var(--danger);
}

.phone-input {
    display: flex;
    gap: 12px;
}

.phone-input select {
    width: 80px;
}

.phone-input input {
    flex: 1;
}

.btn-verify {
    margin-left: 12px;
    padding: 4px 12px;
    background: var(--primary);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 40px;
}

/* Security Section */
.security-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: var(--light);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.security-item:hover {
    background: white;
    box-shadow: var(--shadow);
}

.security-info h3 {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 4px;
}

.security-info p {
    color: var(--gray);
    font-size: 0.9rem;
}

.security-action {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status.enabled {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status.disabled {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.btn-manage,
.btn-change,
.btn-view,
.btn-enable {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--light-gray);
    border-radius: 6px;
    color: var(--dark);
    font-family: var(--font-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-manage:hover,
.btn-change:hover,
.btn-view:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-enable {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-enable:hover {
    background: #0077E6;
    border-color: #0077E6;
}

/* Notifications Section */
.notification-categories {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.category h3 {
    font-size: 1.3rem;
    color: var(--dark);
    margin-bottom: 20px;
}

.notification-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.switch {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
}

.switch input {
    display: none;
}

.slider {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--light-gray);
    border-radius: 14px;
    transition: all 0.3s ease;
}

.slider:before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
    background: var(--primary);
}

.switch input:checked + .slider:before {
    transform: translateX(24px);
}

.switch .label {
    color: var(--dark);
    font-weight: 500;
}

/* Trading Section */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toggle-label {
    color: var(--dark);
    font-weight: 500;
}

.leverage-slider {
    margin-top: 20px;
}

.leverage-slider input[type="range"] {
    width: 100%;
    margin-bottom: 8px;
}

.leverage-value {
    display: flex;
    justify-content: space-between;
    color: var(--gray);
    font-size: 0.9rem;
}

/* API Keys Section */
.api-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.api-header p {
    color: var(--gray);
    max-width: 600px;
}

.api-keys-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

.api-key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: var(--light);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.api-key-item:hover {
    background: white;
    box-shadow: var(--shadow);
}

.api-key-info h3 {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 8px;
}

.key-details {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.key-preview {
    font-family: var(--font-mono);
    color: var(--dark);
}

.key-date {
    color: var(--gray);
}

.key-permissions {
    display: flex;
    gap: 8px;
}

.permission {
    padding: 4px 12px;
    background: rgba(10, 132, 255, 0.1);
    border-radius: 4px;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
}

.api-key-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    width: 40px;
    height: 40px;
    border: 1px solid var(--light-gray);
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--gray);
}

.btn-action:hover {
    transform: translateY(-1px);
}

.btn-action.view:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-action.edit:hover {
    border-color: var(--warning);
    color: var(--warning);
}

.btn-action.delete:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.api-security {
    padding: 30px;
    background: var(--light);
    border-radius: 12px;
}

.api-security h3 {
    font-size: 1.3rem;
    color: var(--dark);
    margin-bottom: 20px;
}

.security-list {
    list-style: none;
    padding-left: 0;
}

.security-list li {
    padding: 8px 0;
    color: var(--gray);
    position: relative;
    padding-left: 24px;
}

.security-list li:before {
    content: '•';
    color: var(--primary);
    font-size: 1.2rem;
    position: absolute;
    left: 0;
    top: 6px;
}

/* Responsive Settings */
@media (max-width: 1200px) {
    .settings-layout {
        grid-template-columns: 240px 1fr;
    }
}

@media (max-width: 992px) {
    .settings-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .settings-sidebar {
        position: sticky;
        top: 20px;
        z-index: 100;
    }
    
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .nav-item {
        white-space: nowrap;
        padding: 12px 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .api-header {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .settings-content {
        padding: 30px 20px;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .security-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .security-action {
        width: 100%;
        justify-content: space-between;
    }
    
    .api-key-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .api-key-actions {
        width: 100%;
        justify-content: flex-end;
    }
}