/* assets/css/components.css - SLUTGILTIG VERSION MED HÖGRE SPECIFICITET */

/* =====================================
   TOP BAR & HAMBURGER
   ===================================== */
.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--border-color); }
.left-section { display: flex; align-items: center; gap: 24px; }
.top-actions { display: flex; align-items: center; gap: 16px; z-index: 10; }
.hamburger { background: none; border: none; cursor: pointer; padding: 8px; border-radius: 6px; transition: all 0.2s ease; width: 36px; height: 36px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.hamburger:hover { background: var(--border-color); }
.hamburger-line { width: 20px; height: 2px; background: var(--text-secondary); border-radius: 1px; display: block; }

/* =====================================
   SIDE MENU (CENTRERAD OVERLAY)
   ===================================== */
body .side-menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 2999; transition: opacity 0.3s ease-in-out; }
body .side-menu {
    position: fixed; top: 50%; left: 50%; width: 90%; max-width: 320px; background: var(--background-card);
    z-index: 3000; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    opacity: 0; visibility: hidden; transform: translate(-50%, -45%); transition: all 0.3s ease-in-out;
}
body .side-menu.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }
.side-menu-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border-color); }
.side-menu-title { font-size: 20px; font-weight: 600; color: var(--text-primary); margin: 0; }
.close-menu { background: none; border: none; font-size: 28px; color: var(--text-secondary); cursor: pointer; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: all 0.2s ease; }
.close-menu:hover { background: var(--border-color); color: var(--text-primary); }
.side-menu-content { padding: 12px; }
.menu-section { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border-color); }
.menu-section:last-child { border-bottom: none; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; font-size: 15px; font-weight: 500; color: var(--text-primary); text-align: left; background: transparent; border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.2s ease; }
.menu-item:hover { background-color: var(--border-color); }

/* =====================================
   GENERELLA OVERLAYS (AUTH, PROFILE, ETC.) - MED HÖGRE SPECIFICITET
   ===================================== */
body .auth-overlay, body .profile-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.auth-content, .profile-content { background: var(--background-card); border-radius: 16px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; animation: slideInAuth 0.3s ease; }
@keyframes slideInAuth { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.profile-content { max-width: 500px; }
.auth-header, .profile-header { display: flex; justify-content: space-between; align-items: center; padding: 24px 28px; border-bottom: 1px solid var(--border-color); }
.auth-header h2, .profile-title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 0; }
.auth-close, .close-profile { background: var(--border-color); border: none; font-size: 20px; color: var(--text-secondary); cursor: pointer; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; transition: all 0.2s ease; }
.auth-close:hover, .close-profile:hover { background: rgba(230, 126, 34, 0.1); color: var(--primary-color); }
.auth-body { padding: 32px 28px; }
.profile-body { padding: 0; }

/* =====================================
   PROFILE OVERLAY SPECIFIK STYLING
   ===================================== */
.profile-section { padding: 24px 32px; border-bottom: 1px solid var(--border-color); }
.profile-section:last-child { border-bottom: none; }
.profile-section-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0 0 20px 0; }
.profile-field { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.profile-field label { font-weight: 500; color: var(--text-secondary); font-size: 14px; }
.profile-field span { color: var(--text-primary); font-weight: 500; }
.plan-info { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.plan-badge { padding: 6px 16px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.plan-badge.free { background: var(--border-color); color: var(--text-secondary); }
.plan-badge.learner { background: #dbeafe; color: #1d4ed8; }
.plan-badge.builder { background: #d1fae5; color: #065f46; }
.plan-badge.master { background: #fef3c7; color: #92400e; }
.requests-info { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.subscription-actions, .account-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.account-actions { margin-top: 0; }

/* =====================================
   FORMULÄR & KNAPPAR INUTI OVERLAYS
   ===================================== */

.auth-body h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 24px 0;
    text-align: center;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 16px; /* Lite mindre avstånd mellan fälten */
}

.email-form input {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    background: var(--background); /* Bakgrund som matchar sidan */
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
}

.email-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.email-form button[type="submit"] {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.email-form button[type="submit"]:hover {
    background: var(--primary-dark);
}

.email-form button[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--background-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    font-weight: 500;
}

.oauth-btn:hover {
    border-color: var(--primary-color);
    background: var(--border-color);
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
    z-index: 1;
}

.auth-divider span {
    background: var(--background-card);
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* =====================================
   GENERELLA KNAPPAR
   ===================================== */
.btn { padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; border: 1px solid transparent; cursor: pointer; transition: all 0.2s ease; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.btn-secondary { background: var(--primary-color); color: white; border-color: var(--primary-color); }
.btn-secondary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline { background: transparent; border-color: var(--border-color); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--text-secondary); background: var(--border-color); }
.btn-danger-outline { background: transparent; border-color: var(--error-color); color: var(--error-color); }
.btn-danger-outline:hover { background: rgba(239, 68, 68, 0.05); }

/* =====================================
   PURCHASE OVERLAY & PLAN CARDS
   ===================================== */
.purchase-content { max-width: 850px; }
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 850px) { .plans-grid { grid-template-columns: 1fr; } }
.plan-card { border: 2px solid var(--border-color); border-radius: 12px; padding: 24px; background: var(--background-card); cursor: pointer; transition: all 0.2s ease; position: relative; text-align: center; display: flex; flex-direction: column; justify-content: space-between; }
.plan-card:hover { transform: translateY(-4px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.plan-card.selected { border-color: var(--primary-color); box-shadow: 0 4px 20px rgba(230, 126, 34, 0.2); }
.popular-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary-color); color: white; padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.plan-card h3 { margin: 12px 0 8px 0; font-size: 22px; color: var(--text-primary); }
.price { font-size: 28px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.features-list { list-style: none; padding: 0; margin: 0 0 24px 0; text-align: left; font-size: 14px; color: var(--text-secondary); flex-grow: 1; }
.features-list li { margin-bottom: 8px; padding-left: 20px; position: relative; }
.features-list li::before { content: '✓'; position: absolute; left: 0; color: var(--success-color); font-weight: bold; }
.select-indicator { padding: 12px; background: var(--border-color); color: var(--text-secondary); border-radius: 8px; font-weight: 600; font-size: 14px; margin-top: auto; transition: all 0.2s ease; }
.plan-card.selected .select-indicator { background: var(--primary-color); color: white; }

/* =====================================
   ALPINE.JS & FOOTER
   ===================================== */
[x-cloak] { display: none !important; }
.footer { margin-top: 60px; padding: 30px 0; border-top: 1px solid var(--border-color); text-align: center; }
.footer p { color: var(--text-secondary); font-size: 14px; margin: 0; }