/* Virtual Actor Shared Variables */
:root {
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-primary: #4f46e5; /* Indigo */
    --accent-secondary: #ec4899; /* Pink */
    --danger-primary: #ef4444;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --input-bg: rgba(0, 0, 0, 0.2);
    --card-radius: 16px;
}

[data-theme="light"] {
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.05);
    --input-bg: rgba(255, 255, 255, 0.5);
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
}

/* =========================================
   Index Page (Actor Grid)
   ========================================= */
.actor-container {
    padding: 2rem 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

.btn-create {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
}

.btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
    color: white;
}

.actor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.actor-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    backdrop-filter: blur(12px);
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.actor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.actor-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.actor-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-primary);
    background: #222;
}

.actor-info h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.actor-archetype {
    font-size: 0.875rem;
    color: var(--accent-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.actor-bio {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.actor-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.actor-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    flex: 1;
    padding: 0.5rem;
    text-align: center;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-primary);
}

.status-dot {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-active { background: #10b981; box-shadow: 0 0 8px #10b981; }
.status-dead { background: #ef4444; }

/* =========================================
   Details Page (Magazine Profile)
   ========================================= */
.profile-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    padding-top: 2rem;
}

@media (max-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr;
    }
}

.identity-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 2rem;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-primary);
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.4);
    margin-bottom: 1.5rem;
}

.profile-name {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.profile-archetype {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 1rem;
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent-primary);
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-meta {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

.meta-label { color: var(--text-muted); }
.meta-value { color: var(--text-primary); font-weight: 500; }

.content-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(12px);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i { color: var(--accent-secondary); }

.bio-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-line;
}

.traits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.trait-card {
    background: rgba(255,255,255,0.03);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.trait-label { font-size: 0.8rem; color: var(--text-muted); display: block; margin-bottom: 0.25rem; }
.trait-value { font-size: 1rem; color: var(--text-primary); font-weight: 600; }

.action-bar {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.btn-edit-profile {
    background: var(--accent-primary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s;
    border: none;
}

.btn-back-profile {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.75rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-edit-profile:hover { transform: translateY(-2px); color: white; }
.btn-back-profile:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

/* =========================================
   Create / Edit Forms
   ========================================= */
.form-container {
    max-width: 900px;
    margin: 2rem auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.form-title {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, var(--accent-primary), #ec4899);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.form-section:last-child { border-bottom: none; }

.section-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-group.full-width {
    grid-column: span 2;
}

.control-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.btn-submit {
    background: var(--accent-primary);
    color: white;
    padding: 1rem 3rem;
    border-radius: 99px;
    font-weight: 700;
    border: none;
    width: 100%;
    font-size: 1.125rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-back-form {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.btn-back-form:hover { color: var(--accent-primary); }

.text-danger {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* =========================================
   Delete Page
   ========================================= */
.delete-container {
    max-width: 600px;
    margin: 4rem auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
    border-top: 6px solid var(--danger-primary);
}

.warning-icon {
    font-size: 4rem;
    color: var(--danger-primary);
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite;
}

.delete-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.delete-message {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.agent-preview {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    text-align: left;
}

.preview-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

.preview-info h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.preview-info span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-delete {
    background: var(--danger-primary);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    border: none;
    width: 100%;
    font-size: 1.125rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-cancel-delete {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 1rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    display: block;
    transition: background 0.2s;
}

.btn-delete:hover { transform: scale(1.02); }
.btn-cancel-delete:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}
