:root {
    --body-bg: radial-gradient(circle at top, #1f1f1f 0%, #0b0b0b 45%);
    --text-color: #ffffff;
    --profile-bg: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.06));
    --profile-border: rgba(255, 255, 255, 0.14);
    --profile-border-hover: rgba(255, 255, 255, 0.3);
    --shadow-color: rgba(34, 34, 34, 0.45);
    --image-border: rgba(255,255,255,0.5);
    --text-shadow: 2px 2px 10px rgba(0,0,0,0.75);
    --header-bg: rgba(0, 0, 0, 0.58);
    --header-border: rgba(255, 255, 255, 0.08);
    --title-bg: rgba(0, 0, 0, 0.5);
    --button-bg: rgba(0,0,0,0.45);
    --button-border: rgba(255,255,255,0.35);
    --button-hover: rgba(255,255,255,0.18);
    --button-text: #f8f8f8;
    --modal-overlay: rgba(0,0,0,0.8);
    --input-bg: rgba(255,255,255,0.06);
    --hover-bg: rgba(255,255,255,0.14);
    --muted-text: rgba(255,255,255,0.35);
}

body.light-theme {
    --body-bg: linear-gradient(135deg, #fff7ed 0%, #fef3c7 25%, #ffffff 58%, #e0f2fe 100%);
    --text-color: #161b22;
    --profile-bg: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,250,240,0.94));
    --profile-border: rgba(251, 146, 60, 0.28);
    --profile-border-hover: rgba(249, 115, 22, 0.55);
    --shadow-color: rgba(251, 146, 60, 0.22);
    --image-border: rgba(249,115,22,0.35);
    --text-shadow: none;
    --header-bg: rgba(255, 255, 255, 0.78);
    --header-border: rgba(251, 146, 60, 0.18);
    --title-bg: linear-gradient(135deg, rgba(255,255,255,0.94), rgba(255,247,237,0.94));
    --button-bg: rgba(255,255,255,0.82);
    --button-border: rgba(251, 146, 60, 0.32);
    --button-hover: rgba(255,255,255,1);
    --button-text: #111827;
    --modal-overlay: rgba(255,255,255,0.68);
    --input-bg: rgba(255,255,255,0.9);
    --hover-bg: rgba(249, 115, 22, 0.12);
    --muted-text: rgba(17,24,39,0.45);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--body-bg);
    color: var(--text-color);
    min-height: 100vh;
    transition: background 0.35s ease, color 0.35s ease;
    padding-top: 84px;
}

.netflix-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 84px;
    padding: 12px 20px;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--header-border);
}

.logo {
    width: auto;
    height: 52px;
    display: block;
    object-fit: contain;
}

.theme-toggle {
    border: 1px solid var(--button-border);
    background: var(--button-bg);
    color: var(--button-text);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.theme-toggle:hover {
    background: var(--button-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 32px 16px;
    text-align: center;
}

h1 {
    font-size: clamp(1.8rem, 2.5vw, 3rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--text-color);
    text-transform: uppercase;
    text-shadow: var(--text-shadow);
    margin: -90px 0 20px;
    background: var(--title-bg);
    padding: 16px 20px;
    border-radius: 18px;
}

body.light-theme h1 {
    color: #111827;
    box-shadow: 0 20px 45px rgba(251, 146, 60, 0.14);
}

.container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    width: min(960px, 100%);
}

.profile-card {
    position: relative;
    display: inline-block;
    margin: 0.7rem;
}

.perfil {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.profile {
    background: var(--profile-bg);
    border: 1px solid var(--profile-border);
    border-radius: 30px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
    height: 100%;
}

.profile:hover,
.profile:focus-within {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--profile-border-hover);
    box-shadow: 0 12px 28px var(--shadow-color);
}

figure {
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.profile img {
    width: 92px;
    height: 92px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid var(--image-border);
    box-shadow: 0 10px 20px rgba(68, 68, 68, 0.35);
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.profile:hover img,
.profile:focus-within img {
    border-color: var(--text-color);
    transform: scale(1.03);
}

figcaption {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profile-card .edit-profile,
.profile-card .change-photo {
    position: absolute;
    top: 8px;
    width: 30px;
    height: 30px;
    border: 1px solid var(--button-border);
    border-radius: 50%;
    background: var(--button-bg);
    color: var(--button-text);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.3s ease, transform 0.3s ease;
}

.profile-card .edit-profile {
    right: 8px;
}

.profile-card .change-photo {
    left: 8px;
}

.profile-card .edit-profile:hover,
.profile-card .change-photo:hover {
    background: var(--button-hover);
    transform: scale(1.05);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: var(--profile-bg);
    border: 1px solid var(--profile-border);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal h2 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.modal input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--profile-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
    margin-bottom: 20px;
}

.modal input:focus {
    outline: none;
    border-color: var(--text-color);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.modal-btn.save {
    background: #e50914;
    color: white;
}

.modal-btn.save:hover {
    background: #f40612;
}

.modal-btn.cancel {
    background: var(--hover-bg);
    color: var(--text-color);
}

.modal-btn.cancel:hover {
    background: var(--muted-text);
}

/* ===== MOBILE PEQUENO (até 360px) ===== */
@media (max-width: 360px) {
    body {
        padding-top: 60px;
    }

    .netflix-header {
        min-height: 60px;
        padding: 8px 10px;
    }

    .logo {
        height: 40px;
    }

    .theme-toggle {
        font-size: 0.75rem;
        padding: 8px 10px;
        letter-spacing: 0.02em;
    }

    main {
        padding: 16px 8px;
        min-height: calc(100vh - 60px);
    }

    h1 {
        font-size: clamp(1.4rem, 3.5vw, 2rem);
        margin: -40px 0 20px;
        padding: 12px 16px;
        border-radius: 12px;
    }

    .container {
        gap: 10px;
        width: 100%;
    }

    .profile-card {
        margin: 0.3rem;
    }

    .profile {
        border-radius: 16px;
    }

    figure {
        padding: 10px;
        gap: 6px;
    }

    .profile img {
        width: 60px;
        height: 60px;
    }

    figcaption {
        font-size: 0.75rem;
        letter-spacing: 0.02em;
    }

    .profile-card .edit-profile {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
        top: 4px;
        right: 4px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .modal h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .modal input {
        padding: 10px;
        font-size: 0.95rem;
        margin-bottom: 15px;
    }

    .modal-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* ===== MOBILE MÉDIO (361px - 480px) ===== */
@media (min-width: 361px) and (max-width: 480px) {
    body {
        padding-top: 68px;
    }

    .netflix-header {
        min-height: 68px;
        padding: 10px 14px;
    }

    .logo {
        height: 44px;
    }

    .theme-toggle {
        font-size: 0.8rem;
        padding: 9px 12px;
    }

    main {
        padding: 18px 10px;
        min-height: calc(100vh - 68px);
    }

    h1 {
        font-size: clamp(1.5rem, 3.8vw, 2.2rem);
        margin: -60px 0 25px;
        padding: 14px 18px;
        border-radius: 14px;
    }

    .container {
        gap: 12px;
        width: 100%;
    }

    .profile-card {
        margin: 0.35rem;
    }

    .profile {
        border-radius: 18px;
    }

    figure {
        padding: 12px;
        gap: 8px;
    }

    .profile img {
        width: 68px;
        height: 68px;
    }

    figcaption {
        font-size: 0.8rem;
    }

    .profile-card .edit-profile {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
        top: 6px;
        right: 6px;
    }

    .modal-content {
        width: 92%;
        padding: 24px;
    }

    .modal h2 {
        font-size: 1.3rem;
    }
}

/* ===== MOBILE GRANDE (481px - 768px) ===== */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding-top: 76px;
    }

    .netflix-header {
        min-height: 76px;
        padding: 12px 18px;
    }

    .logo {
        height: 48px;
    }

    .theme-toggle {
        font-size: 0.9rem;
        padding: 10px 14px;
    }

    main {
        padding: 24px 12px;
        min-height: calc(100vh - 76px);
    }

    h1 {
        font-size: clamp(1.6rem, 4vw, 2.4rem);
        margin: -70px 0 28px;
        padding: 15px 20px;
        border-radius: 16px;
    }

    .container {
        gap: 14px;
        width: 100%;
        max-width: 600px;
    }

    .profile-card {
        margin: 0.4rem;
    }

    .profile {
        border-radius: 20px;
    }

    figure {
        padding: 14px;
        gap: 10px;
    }

    .profile img {
        width: 76px;
        height: 76px;
    }

    figcaption {
        font-size: 0.85rem;
    }

    .profile-card .edit-profile {
        width: 30px;
        height: 30px;
        top: 8px;
        right: 8px;
    }
}

/* ===== TABLET (769px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    body {
        padding-top: 80px;
    }

    .netflix-header {
        min-height: 80px;
        padding: 14px 20px;
    }

    .logo {
        height: 50px;
    }

    .theme-toggle {
        font-size: 0.95rem;
        padding: 11px 16px;
    }

    main {
        padding: 28px 16px;
        min-height: calc(100vh - 80px);
    }

    h1 {
        font-size: clamp(1.8rem, 4.5vw, 2.6rem);
        margin: -80px 0 32px;
        padding: 18px 24px;
        border-radius: 18px;
    }

    .container {
        gap: 18px;
        width: 100%;
        max-width: 700px;
    }

    .profile-card {
        margin: 0.5rem;
    }

    .profile {
        border-radius: 22px;
    }

    figure {
        padding: 16px;
        gap: 12px;
    }

    .profile img {
        width: 84px;
        height: 84px;
    }

    figcaption {
        font-size: 0.95rem;
    }

    .modal-content {
        width: 85%;
        max-width: 450px;
    }
}

/* ===== DESKTOP PEQUENO (1025px - 1440px) ===== */
@media (min-width: 1025px) and (max-width: 1440px) {
    .container {
        gap: 20px;
        width: min(900px, 100%);
    }

    .profile-card {
        margin: 0.6rem;
    }

    .profile img {
        width: 90px;
        height: 90px;
    }

    figure {
        padding: 20px;
        gap: 12px;
    }
}

/* ===== DESKTOP GRANDE (acima de 1441px) ===== */
@media (min-width: 1441px) {
    main {
        padding: 40px 24px;
    }

    h1 {
        margin: -100px 0 40px;
        padding: 20px 28px;
        font-size: 3rem;
    }

    .container {
        gap: 24px;
        width: min(1000px, 100%);
    }

    .profile-card {
        margin: 0.8rem;
    }

    .profile img {
        width: 100px;
        height: 100px;
    }

    figure {
        padding: 24px;
        gap: 14px;
    }

    figcaption {
        font-size: 1.1rem;
    }
}
