/* Settings Section Styles */
#settings-section {
    position: relative;
    z-index: 2;
    display: none;
    padding-top: 90px;
    width: 96%;
    margin: auto;
}

#settings-section.active {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#settings-section main {
    padding: 0;
    width: 100%;
}

.settings-container {
    width: 100%;
    max-width: 600px; /* Same max-width as profile forms */
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 8px;
  
}

.settings-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: lighter;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
}

.settings-tab-btn i {
    font-size: 16px;
}

.settings-tab-btn:hover {
    color: #495057;
    background: rgba(102, 126, 234, 0.05);
}

.settings-tab-btn.active {
    color: #495057;
    border-bottom-color: #667eea;
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-card {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    margin-bottom: 3rem;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0 16px 0;
    border-bottom: 1px solid #e5e7eb;
    background: transparent;
}

.settings-card-header i {
    font-size: 20px;
    color: #6c757d;
}

.settings-card-header h2 {
    font-size: 14px;
    font-weight: lighter;
    color: #495057;
    margin: 0;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-card-body {
    padding: 24px 0;
}

/* Form label styles now in form-sections-shared.css */

.field-description {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

/* Input styles now in form-sections-shared.css */
.input-with-unit input {
    flex: 1;
}

.unit-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    min-width: 60px;
}

.time-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-btn,
.preset-btn-refresh {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #667eea;
    background: #f0f3ff;
    border: 1px solid #667eea;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.preset-btn:hover,
.preset-btn-refresh:hover {
    background: #667eea;
    color: #fff;
}

.current-settings-info {
    margin-top: 32px;
    padding: 20px 0;
    background: transparent;
    border-radius: 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

.current-settings-info h3 {
    font-size: 12px;
    font-weight: lighter;
    color: #495057;
    margin: 0 0 16px 0;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-grid {
    display: grid;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    background: transparent;
    border-radius: 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

/* Submit and cancel button styles now in form-sections-shared.css */

/* Loading and message states */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    padding: 16px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #fecaca;
}

.success-message {
    padding: 16px;
    background: #f0fdf4;
    color: #16a34a;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #bbf7d0;
}

.access-denied {
    text-align: center;
    padding: 60px 20px;
}

.access-denied i {
    font-size: 64px;
    color: #dc2626;
    margin-bottom: 20px;
}

.access-denied h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.access-denied p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Logo Upload Styles */
.logo-upload-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.logo-preview {
    width: 100%;
    min-height: 120px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    padding: 20px;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
}

.logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #999;
}

.logo-placeholder i {
    font-size: 48px;
}

.logo-placeholder span {
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.logo-upload-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.logo-upload-actions label {
    cursor: pointer;
    margin-top: 0;
}

.upload-status {
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    display: none;
}

.upload-status.success {
    display: block;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.upload-status.error {
    display: block;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Font controls row styling */
.font-controls-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.font-control {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Color picker without opacity slider */
.font-control:last-child:not(:has(.opacity-control-wrapper)) {
    flex: 0 0 80px; /* Fixed width for color picker */
}

/* Color picker or control with opacity slider - give more space */
.font-control:has(.opacity-control-wrapper) {
    flex: 1 1 200px; /* More flexible width for opacity controls */
    min-width: 180px;
}

/* Extended font controls (for 4 controls like form labels) */
.font-controls-extended .font-control:nth-child(3) {
    flex: 0 0 90px; /* Fixed width for font size select */
}

.small-label {
    font-size: 11px;
    font-weight: lighter;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-family: 'Inter', sans-serif;
}

/* Color input styling */
.font-control input[type="color"] {
    height: 44px;
    padding: 2px;
    cursor: pointer;
    width: 100%;
    min-width: 80px;
    border: 2px solid #c1c1c1;
    border-radius: 6px;
    background: white;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: border-color 0.2s ease;
}

.font-control input[type="color"]:hover {
    border-color: #667eea;
}

.font-control input[type="color"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.font-control input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 4px;
}

.font-control input[type="color"]::-webkit-color-swatch {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.font-control input[type="color"]::-moz-color-swatch {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.font-control select {
    width: 100%;
}

/* Input styling groups */
.input-styling-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-style-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subsection-label {
    font-size: 11px;
    font-weight: 500;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
    margin: 0;
}

/* Appearance Subtabs */
.appearance-subtabs {
    display: flex;
    gap: 8px;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
    padding-left: 0;
}

.appearance-subtab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: lighter;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
}

.appearance-subtab-btn i {
    font-size: 16px;
}

.appearance-subtab-btn:hover {
    color: #495057;
    background: rgba(102, 126, 234, 0.05);
}

.appearance-subtab-btn.active {
    color: #495057;
    border-bottom-color: #667eea;
}

.appearance-subtab-content {
    display: none;
}

.appearance-subtab-content.active {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    #settings-section {
        padding: 1rem;
    }

    .settings-container {
        max-width: 100%;
    }

    .settings-tabs {
        gap: 0;
        overflow-x: auto;
    }

    .settings-tab-btn {
        white-space: nowrap;
        font-size: 11px;
        padding: 10px 12px;
    }

    .time-presets {
        flex-direction: column;
    }

    .preset-btn,
    .preset-btn-refresh {
        width: 100%;
    }

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

    .cancel-btn,
    .submit-btn {
        width: 100%;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .logo-upload-actions {
        flex-direction: column;
    }

    .logo-upload-actions label,
    .logo-upload-actions button {
        width: 100%;
        justify-content: center;
    }

    /* Stack font controls vertically on mobile */
    .font-controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .font-control:last-child {
        flex: 1; /* Full width on mobile */
    }

    /* Responsive for appearance subtabs */
    .appearance-subtabs {
        flex-direction: column;
        gap: 0;
        overflow-x: auto;
    }

    .appearance-subtab-btn {
        white-space: nowrap;
        font-size: 11px;
        padding: 10px 12px;
    }
}

/* Opacity Control Styles */
.opacity-control-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 44px; /* Match input height */
}

.opacity-slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.5) 50%, #667eea 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    min-width: 100px;
}

.opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: grab;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
}

.opacity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.opacity-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.15);
}

.opacity-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: grab;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
}

.opacity-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.opacity-slider::-moz-range-thumb:active {
    cursor: grabbing;
    transform: scale(1.15);
}

.opacity-value {
    min-width: 45px;
    text-align: right;
    font-size: 12px;
    color: #495057;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

/* Color Preview Box */
.color-preview-box {
    width: 100%;
    height: 44px;
    border: 2px solid #c1c1c1;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    /* Checkerboard pattern to show transparency */
    background-image: 
        linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
        linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
}

.color-preview-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: currentColor;
}

@media (max-width: 480px) {
    #settings-section {
        padding: 0.5rem;
    }

    .settings-tab-btn {
        font-size: 10px;
        padding: 8px 10px;
    }

    .input-with-unit {
        flex-direction: column;
        align-items: stretch;
    }

    .unit-label {
        text-align: left;
    }
}










