/* =============================================
   Author Profile Settings Page Styles
   Modern design consistent with AuthorStats and ProfileSettings
   ============================================= */

/* Hero Section */
.aps-hero {
    position: relative;
    padding: 0;
    margin-bottom: 2rem;
    overflow: hidden;
}

.aps-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #00b4ff 0%, #0066cc 100%);
    z-index: 0;
}

.aps-hero-overlay {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 1;
}

.aps-hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: calc(80px + 3rem) 1.5rem 2.5rem;
}

.aps-hero-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    backdrop-filter: blur(10px);
}

.aps-hero-icon i {
    font-size: 2.5rem;
    color: white;
}

.aps-hero-content h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.aps-hero-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin: 0;
}

/* Main Content */
.aps-content {
    padding: 0 1.5rem 3rem;
}

.aps-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Tab Navigation */
.aps-tabs {
    display: flex;
    background: var(--card-background, #ffffff);
    border-radius: 1rem;
    padding: 0.5rem;
    gap: 0.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.aps-tab {
    flex: 1;
    min-width: fit-content;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary, #666);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

.aps-tab:hover {
    background: rgba(0, 180, 255, 0.08);
    color: var(--primary-color, #00b4ff);
}

.aps-tab.active {
    background: linear-gradient(135deg, #00b4ff, #0066cc);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 180, 255, 0.3);
}

.aps-tab i {
    font-size: 1.1rem;
}

/* Warning Badge */
.aps-warning-dot {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #ff9800;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Panel */
.aps-panel {
    background: var(--card-background, #ffffff);
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.aps-panel-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color, #eee);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.aps-panel-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #333);
}

.aps-panel-title i {
    color: var(--primary-color, #00b4ff);
}

/* Alert Banner */
.aps-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    margin: 1.5rem;
    border-radius: 0.75rem;
}

.aps-alert.warn {
    background: rgba(255, 152, 0, 0.1);
    border-left: 4px solid #ff9800;
}

.aps-alert.warn i {
    color: #ff9800;
    font-size: 1.25rem;
    margin-top: 0.1rem;
}

.aps-alert.warn h4 {
    color: #f57f17;
    font-weight: 600;
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.aps-alert.warn p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

.aps-alert.success {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    margin: 0 2rem 1rem;
    background: rgba(40, 167, 69, 0.1);
    border-left: 4px solid #28a745;
    border-radius: 0.5rem;
    color: #28a745;
}

.aps-alert.error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    margin: 0 2rem 1rem;
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
    border-radius: 0.5rem;
    color: #dc3545;
}

.aps-alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.aps-alert-close:hover {
    opacity: 1;
}

/* Cards */
.aps-card {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color, #eee);
}

.aps-card:last-child {
    border-bottom: none;
}

.aps-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.aps-card-header i {
    color: var(--primary-color, #00b4ff);
    font-size: 1.5rem;
}

.aps-card-header h4 {
    font-weight: 600;
    color: var(--text-primary, #333);
    margin: 0;
}

.aps-card-header p {
    color: var(--text-secondary, #666);
    font-size: 0.875rem;
    margin: 0;
}

/* Profile Picture Section */
.aps-picture-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
}

.aps-avatar-wrap {
    position: relative;
}

.aps-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.aps-avatar-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #f0f0f0;
}

.aps-avatar-placeholder i {
    font-size: 4rem;
    color: #aaa;
}

.aps-avatar-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dc3545;
    border: 2px solid white;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.aps-avatar-remove:hover {
    transform: scale(1.1);
}

.aps-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.aps-hint {
    color: #666;
    font-size: 0.85rem;
    text-align: center;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.aps-hint i {
    color: #888;
    font-size: 0.9rem;
    margin-top: 0.1rem;
}

/* Form Styles */
.aps-form-group {
    margin-bottom: 1.25rem;
}

.aps-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .aps-form-row {
        grid-template-columns: 1fr;
    }
}

.aps-form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary, #333);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.aps-form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--input-background, #fff);
    color: var(--text-primary, #333);
    box-sizing: border-box;
}

.aps-form-input:focus {
    outline: none;
    border-color: var(--primary-color, #00b4ff);
    box-shadow: 0 0 0 3px rgba(0, 180, 255, 0.15);
}

.aps-form-input::placeholder {
    color: #aaa;
}

/* Slug Feedback */
.aps-slug {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    border-left: 3px solid;
}

.aps-slug.checking {
    background: rgba(108, 117, 125, 0.1);
    border-left-color: #6c757d;
    color: #666;
}

.aps-slug.available {
    background: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
    color: #28a745;
}

.aps-slug.taken {
    background: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
    color: #dc3545;
}

.aps-slug-suggest {
    background: none;
    border: none;
    color: #00b4ff;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.85rem;
}

/* Bio Editor */
.aps-bio-editor {
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 0.75rem;
    overflow: hidden;
}

.aps-bio-editor:focus-within {
    border-color: var(--primary-color, #00b4ff);
    box-shadow: 0 0 0 3px rgba(0, 180, 255, 0.15);
}

.aps-bio-counter {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.aps-bio-counter.warning {
    color: #ff9800;
    font-weight: 600;
}

.aps-bio-counter.danger {
    color: #dc3545;
    font-weight: 700;
}

/* Actions */
.aps-actions {
    padding: 1.5rem 2rem;
    background: var(--subtle-background, #f8f9fa);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.aps-btn-save {
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.aps-btn-save:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.aps-btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.aps-save-hint {
    color: #666;
    font-size: 0.9rem;
}

/* Empty State */
.aps-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.aps-empty i {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 1.5rem;
}

.aps-empty h3 {
    color: #666;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.aps-empty p {
    color: #999;
    max-width: 400px;
    margin: 0 auto;
}

/* Loading State */
.aps-loading {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.aps-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0, 180, 255, 0.2);
    border-top-color: #00b4ff;
    border-radius: 50%;
    animation: aps-spin 0.8s linear infinite;
}

.aps-spinner-sm {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: aps-spin 0.8s linear infinite;
}

@keyframes aps-spin {
    to { transform: rotate(360deg); }
}

/* Author Selector */
.aps-selector {
    padding: 1rem 2rem;
    background: var(--subtle-background, #f8f9fa);
    border-bottom: 1px solid var(--border-color, #eee);
}

/* Certification */
.aps-certify {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 0;
}

/* Payout Stats */
.aps-payout-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.aps-payout-stat {
    padding: 1.25rem;
    border-radius: 1rem;
    text-align: center;
}

.aps-payout-stat.green {
    background: rgba(40, 167, 69, 0.1);
}

.aps-payout-stat.amber {
    background: rgba(255, 152, 0, 0.1);
}

.aps-payout-stat.purple {
    background: rgba(156, 39, 176, 0.1);
}

.aps-payout-stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.aps-payout-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #333);
}

/* Requirements */
.aps-requirements {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.aps-req {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.aps-link-btn {
    background: none;
    border: none;
    color: #00b4ff;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.85rem;
    padding: 0;
}

/* Status Badge */
.aps-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.aps-badge.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.aps-badge.warning {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

/* Dark Mode */
body.dark-mode .aps-panel {
    background: var(--card-background, #1e293b);
}

body.dark-mode .aps-card {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .aps-panel-title {
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .aps-card-header h4 {
    color: var(--text-primary, #e0e0e0);
}

body.dark-mode .aps-card-header p {
    color: var(--text-secondary, #9ca3af);
}

body.dark-mode .aps-form-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

body.dark-mode .aps-form-label {
    color: var(--text-secondary, #9ca3af);
}

body.dark-mode .aps-alert.warn {
    background: rgba(255, 152, 0, 0.15);
}

body.dark-mode .aps-alert.warn p {
    color: var(--text-secondary, #9ca3af);
}

body.dark-mode .aps-actions {
    background: rgba(0, 0, 0, 0.2);
}

body.dark-mode .aps-selector {
    background: rgba(0, 0, 0, 0.2);
}

/* Radzen HTML Editor Dark Mode */
body.dark-mode .rz-html-editor {
    background: var(--card-background, #1e1e1e) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .rz-html-editor-content {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary, #e0e0e0) !important;
}

body.dark-mode .rz-html-editor-toolbar {
    background: rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .rz-html-editor-toolbar button {
    color: var(--text-secondary, #9ca3af) !important;
    border-color: transparent !important;
}

body.dark-mode .rz-html-editor-toolbar button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary, #e0e0e0) !important;
}

body.dark-mode .rz-html-editor-toolbar button.rz-state-active {
    background: var(--primary-color, #00b4ff) !important;
    color: #0a1628 !important;
}

body.dark-mode .rz-html-editor-separator {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Bio counter dark mode */
body.dark-mode .aps-bio-counter {
    color: var(--text-secondary, #9ca3af);
}

body.dark-mode .aps-bio-counter.warning {
    color: #f59e0b;
}

body.dark-mode .aps-bio-counter.danger {
    color: #ef4444;
}

/* Responsive */
@media (max-width: 768px) {
    .aps-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .aps-tab span {
        display: none;
    }

    .aps-tab {
        padding: 1rem;
    }

    .aps-card {
        padding: 1.25rem 1rem;
    }

    .aps-actions {
        padding: 1.25rem 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .aps-btn-save {
        justify-content: center;
    }

    .aps-save-hint {
        text-align: center;
    }
}
