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

/* Tema padrão (dark) */
:root {
    --bg: #141414;
    --text: #fff;
    --subtext: #808080;
    --card: #1f1f1f;
    --border: rgba(255, 255, 255, 0);
    --devflix-blue: #007acc;
    --devflix-blue-light: #4fc3f7;
    --devflix-blue-dark: #005999;
}

.light {
    --bg: #f3f4f6;
    --text: #111;
    --subtext: #555;
    --card: #fff;
    --border: rgba(0, 0, 0, 0.1);
    --devflix-blue: #1565c0;
    --devflix-blue-light: #42a5f5;
    --devflix-blue-dark: #0d47a1;
}

/* Animações DevFlix */
@keyframes devflix-glow {
    0%, 100% {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25), 0 0 5px var(--devflix-blue), 0 0 10px var(--devflix-blue), 0 0 15px var(--devflix-blue);
    }
    50% {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25), 0 0 10px var(--devflix-blue-light), 0 0 20px var(--devflix-blue-light), 0 0 30px var(--devflix-blue-light);
    }
}

@keyframes devflix-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes devflix-slide-in {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes devflix-border-glow {
    0%, 100% {
        border-color: transparent;
    }
    50% {
        border-color: var(--devflix-blue);
    }
}

/* Body */
body {
    background-image:
        linear-gradient(rgba(20, 20, 20, 0.7), rgba(20, 20, 20, 0.7)),
        url('../assets/logo da pagina de perfis.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    min-height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

body.light {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)),
        url('../assets/logo da pagina de perfis modo claro.png');
    color: var(--text);
}


/* Header */
header {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: min(900px, 95vw);
    text-align: center;
    padding: 14px 0 6px;
}

.logo {
    width: 260px;
    height: auto;
    max-width: 100%;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(0, 122, 204, 0.3));
}

header h1 {
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    font-weight: 700;
    letter-spacing: 1.2px;
    margin-bottom: 6px;
    background: linear-gradient(45deg, var(--devflix-blue), var(--devflix-blue-light), var(--devflix-blue-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 24px rgba(0, 122, 204, 0.35);
}

.theme-toggle {
    appearance: none;
    border: 2px solid var(--devflix-blue);
    background: linear-gradient(135deg, var(--devflix-blue), var(--devflix-blue-light));
    color: white;
    padding: 10px 18px 10px 18px;
    padding-right: 36px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 122, 204, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.theme-toggle:hover::before {
    left: 100%;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 122, 204, 0.5);
    border-color: var(--devflix-blue-light);
    background: linear-gradient(135deg, var(--devflix-blue-light), var(--devflix-blue));
}

.theme-toggle:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 122, 204, 0.3);
}

/* Ícones para o toggle de tema */
.theme-toggle::after {
    content: '🌙';
    font-size: 1.2em;
    transition: all 0.3s ease;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
}

.theme-toggle.light-mode::after {
    content: '☀️';
}

/* Main */
main {
    width: min(900px, 95vw);
    margin: 0 auto 30px;
    padding: 0 6px;
}

.profiles {
    gap: 14px;
}

.profile {
    min-height: 220px;
}

/* GRID RESPONSIVO */
.profiles {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 200px));
    gap: 10px;
    justify-items: center;
}

/* Profile */
.profile {
    text-align: center;
    background: var(--card);
    padding: 8px 10px;
    border-radius: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    animation: devflix-slide-in 0.45s ease-out forwards;
    box-shadow: none;
}

.profile:nth-child(1) { animation-delay: 0.05s; }
.profile:nth-child(2) { animation-delay: 0.1s; }
.profile:nth-child(3) { animation-delay: 0.15s; }
.profile:nth-child(4) { animation-delay: 0.2s; }

.profile::before {
    display: none;
}

.profile:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
    border-color: rgba(0, 122, 204, 0.25);
}

/* Image */
.profile img {
    width: 100%;
    max-width: 160px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.profile:hover img {
    border: 3px solid var(--devflix-blue);
    box-shadow: 0 0 15px var(--devflix-blue-light);
}

/* Name */
.profile figcaption {
    margin-top: 12px;
    color: #808080;
    transition: all 0.3s ease;
    position: relative;
}

.profile:hover figcaption {
    color: var(--devflix-blue-light);
    text-shadow: 0 0 8px var(--devflix-blue);
}

/* RESPONSIVIDADE EXTRA */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.btn-action,
.btn-primary,
.btn-secondary,
.manage-btn {
    appearance: none;
    border: 2px solid var(--devflix-blue);
    background: linear-gradient(135deg, var(--devflix-blue), var(--devflix-blue-light));
    color: white;
    padding: 10px 18px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 122, 204, 0.3);
}

.btn-action::before,
.btn-primary::before,
.btn-secondary::before,
.manage-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-action:hover::before,
.btn-primary:hover::before,
.btn-secondary:hover::before,
.manage-btn:hover::before {
    left: 100%;
}

.btn-action:hover,
.btn-primary:hover,
.btn-secondary:hover,
.manage-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 122, 204, 0.5);
    border-color: var(--devflix-blue-light);
    background: linear-gradient(135deg, var(--devflix-blue-light), var(--devflix-blue));
}

.btn-action:active,
.btn-primary:active,
.btn-secondary:active,
.manage-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 122, 204, 0.3);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.55);
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: min(420px, 95vw);
    background: var(--card);
    color: var(--text);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border);
}

.modal-content h2 {
    margin-bottom: 12px;
}

.modal-content label {
    display: block;
    margin: 8px 0 4px;
    color: var(--subtext);
}

.modal-content input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
}

.modal-buttons {
    margin-top: 14px;
    display: flex;
    gap: 10px;
}

.image-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin: 10px 0;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.1);
}

.image-option {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.image-option:hover {
    border-color: var(--devflix-blue);
    transform: scale(1.05);
}

.image-option.selected {
    border-color: var(--devflix-blue);
    box-shadow: 0 0 10px var(--devflix-blue);
    background: rgba(0, 122, 204, 0.1);
}

.image-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.management-actions {
    margin-top: 10px;
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.edit-btn,
.delete-btn {
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 0.7rem;
}

.delete-btn {
    border-color: #ff5b5b;
}

.edit-btn {
    border-color: #40c3ff;
}
