* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #007AFF;
    --secondary: #5856D6;
    --success: #34C759;
    --danger: #FF3B30;
    --warning: #FF9500;
    --bg-primary: #000000;
    --bg-secondary: #1C1C1E;
    --bg-tertiary: #2C2C2E;
    --text-primary: #FFFFFF;
    --text-secondary: #98989D;
    --border: #38383A;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
    position: relative;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header p {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 400;
}

.user-menu {
    position: absolute;
    top: 20px;
    right: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.credits-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.credits-display svg {
    color: var(--primary);
}

.user-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.user-btn:active {
    transform: scale(0.95);
}

.user-dropdown {
    position: absolute;
    top: 54px;
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 14px;
    min-width: 180px;
    display: none;
    overflow: hidden;
    box-shadow: 0 10px 40px var(--shadow);
    z-index: 100;
}

.user-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown a {
    display: block;
    padding: 14px 18px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
    font-size: 15px;
}

.user-dropdown a:hover {
    background: var(--bg-secondary);
}

.user-dropdown a:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.blocks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-bottom: 40px;
}

.block-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.block-item:active {
    transform: scale(0.92);
}

.block-locked {
    cursor: pointer;
    position: relative;
}

.block-locked:hover {
    transform: scale(1.02);
}

/* --- INÍCIO DAS ALTERAÇÕES --- */
.block-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Mudou de 0.7 para 0.3 para ficar mais transparente */
    background: rgba(0, 0, 0, 0.3);
    /* Mudou de 4px para 2px para um blur menor */
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    transition: all 0.3s;
}

.block-locked:hover .block-overlay {
    /* Mudou de 0.8 para 0.5 para não escurecer tanto no hover */
    background: rgba(0, 0, 0, 0.5);
}
/* --- FIM DAS ALTERAÇÕES --- */

.block-overlay svg {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.1); opacity: 1; }
}

.block-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 22px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-tertiary);
    margin-bottom: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.block-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1), rgba(88, 86, 214, 0.1));
    opacity: 0;
    transition: opacity 0.3s;
}

.block-item:hover .block-image::before {
    opacity: 1;
}

.block-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.block-placeholder span {
    font-size: 28px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.block-title {
    font-size: 13px;
    text-align: center;
    color: var(--text-primary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    font-weight: 500;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.modal-blur {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content {
    padding: 36px 32px;
}

.modal-content h2 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-content h2::before {
    content: '';
    font-size: 32px;
}

.modal-content > p {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 15px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 16px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    background: var(--bg-primary);
}

.form-group a {
    display: inline-block;
    margin-top: 8px;
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.form-group a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #0051D5;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #D32F2F;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 59, 48, 0.4);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #28A745;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(52, 199, 89, 0.4);
}

.modal-message {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    display: none;
    line-height: 1.5;
}

.modal-message.show {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-message.success {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.modal-message.error {
    background: rgba(255, 59, 48, 0.15);
    color: var(--danger);
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
    min-height: 100vh;
}

.admin-header {
    margin-bottom: 40px;
}

.admin-header h1 {
    font-size: 36px;
    margin-bottom: 24px;
    font-weight: 700;
}

.admin-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.admin-nav a {
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 15px;
}

.admin-nav a:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.admin-nav a.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.card h3 {
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background: var(--bg-tertiary);
}

table img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 10px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
}

.file-upload {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-upload input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-upload-label {
    display: block;
    padding: 16px 18px;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border);
    border-radius: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-size: 15px;
}

.file-upload-label:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 122, 255, 0.05);
}

.image-preview {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 16px;
    margin-top: 16px;
    border: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-tertiary);
    padding: 28px;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card h4 {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-card .value {
    font-size: 40px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 15px;
}

@media (max-width: 768px) {
    .admin-container {
        padding: 20px;
    }
    
    .card {
        padding: 24px;
    }
    
    table {
        font-size: 14px;
    }
    
    table th,
    table td {
        padding: 12px 8px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .blocks-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .header h1 {
        font-size: 28px;
    }
    
    .modal-content {
        padding: 28px 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}