:root {
    --bg-color: #1A1A1A;
    --sidebar-bg: #111111;
    --text-main: #FFFFFF;
    --text-muted: #E0E0E0;
    --accent-color: #1E90FF;
    --neon-accent: #00F0FF;
    --success-color: #00D18A;
    --border-color: #2D2D2D;
    --card-bg: #262626;
    --shadow: 0 2px 4px rgba(0,0,0,0.3);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
}

.btn-sidebar-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-sidebar-toggle:hover {
    background: rgba(30, 144, 255, 0.1);
    color: var(--neon-accent);
}

.logo {
    display: flex;
    align-items: center;
    padding-left: 1rem;
}

.logo img {
    max-width: 180px;
    height: auto;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 1rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    margin-bottom: 5px;
    font-weight: 500;
}

.sidebar li:hover, .sidebar li.active {
    background-color: rgba(30, 144, 255, 0.1);
    color: var(--neon-accent);
}

.sidebar li.active i {
    filter: drop-shadow(0 0 5px var(--neon-accent));
}

/* Estado Recolhido */
.sidebar.collapsed {
    width: 80px;
    padding: 2rem 0.5rem;
}

.sidebar.collapsed .logo {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
}

.sidebar.collapsed li span {
    display: none;
}

.sidebar.collapsed li {
    justify-content: center;
    padding: 12px;
}

/* Content Area */
.content {
    flex: 1;
    padding: 2rem 3rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.75rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 35px;
    height: 35px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--border-color);
}

.stat-card i { color: var(--neon-accent); }
.stat-card h3 { font-size: 0.875rem; color: var(--text-muted); }
.stat-card p { 
    font-size: 1.75rem; 
    font-weight: 700; 
    font-family: 'Roboto Mono', monospace;
}

/* Tables & Grids */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-primary:hover {
    background: #187bcd;
    box-shadow: 0 0 15px rgba(30, 144, 255, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover { background: rgba(255,255,255,0.05); }

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
}

.btn-danger:hover { background: #dc2626; }

table {
    width: 100%;
    background: var(--card-bg);
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th { background: rgba(255,255,255,0.03); color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }

/* Ads Grid */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.ad-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.ad-thumb {
    width: 100%;
    height: 150px;
    background: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.ad-thumb img, .ad-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ad-card:hover .ad-thumb img, 
.ad-card:hover .ad-thumb video {
    transform: scale(1.05);
}

.video-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.7);
    color: white;
    padding: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    transition: var(--transition);
}

.video-hint i, .video-hint svg {
    width: 20px;
    height: 20px;
}

.ad-card:hover .video-hint {
    background: var(--neon-accent);
    transform: translate(-50%, -50%) scale(1.1);
    color: #000;
}

.video-hint .hover-icon { display: none; }
.ad-card:hover .video-hint .play-icon { display: none; }
.ad-card:hover .video-hint .hover-icon { display: block; }

.ad-card-actions {
    z-index: 10;
}

.ad-info { padding: 1rem; }
.status-pill {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}
.status-active { background: rgba(0, 209, 138, 0.2); color: var(--success-color); }
.status-inactive { background: #fee2e2; color: #991b1b; }

/* Loading State */
.loading-shimmer {
    opacity: 0.6;
    pointer-events: none;
}

/* Actions Styling */
.actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-muted);
}

.btn-action:hover {
    background: rgba(255,255,255,0.1);
    color: var(--neon-accent);
}

.btn-action.delete:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-color);
    border-radius: 16px;
    width: 550px;
    max-width: 95%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    border: 1px solid var(--accent-color);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.02);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.close-btn {
    background: rgba(255,255,255,0.05);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

#modal-body {
    padding: 1.5rem;
}

.form-group { margin-bottom: 1.25rem; }
.form-group label { 
    display: block; 
    margin-bottom: 6px; 
    font-size: 0.85rem; 
    font-weight: 600; 
    color: var(--text-muted);
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
    background-color: #111111;
    color: white;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--neon-accent);
    background-color: #000;
    box-shadow: 0 0 0 4px rgba(0, 240, 255, 0.1);
}

form .btn-primary {
    width: 100%;
    margin-top: 1rem;
    padding: 12px;
    justify-content: center;
}

/* Search Box */
.search-box {
    position: relative;
    flex: 1;
    max-width: 350px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: #111111;
    color: white;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box i, .search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
    pointer-events: none;
    display: flex;
    align-items: center;
}

/* Ad Card Actions */
.ad-card {
    position: relative;
}

.ad-card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.ad-card:hover .ad-card-actions {
    opacity: 1;
}

.ad-card-actions .btn-action {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* Modal Size Variants */
.modal-content.modal-sm {
    width: 400px;
}

.modal-content.modal-sm .modal-header {
    display: none; /* Esconde o header padrão em diálogos de confirmação */
}

/* Dialog Specifics */
.dialog-content {
    text-align: center;
    padding: 1rem 0.5rem;
}

.dialog-icon {
    margin: 0 auto 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 14px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dialog-icon:hover {
    transform: scale(1.1) rotate(2deg);
}

.dialog-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.dialog-message {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 0 0.5rem;
}

.dialog-footer {
    display: flex;
    gap: 12px;
    width: 100%;
}

.dialog-footer button {
    flex: 1;
    justify-content: center;
    height: 44px;
}

/* Custom Searchable Select */
.searchable-select-container {
    position: relative;
    width: 100%;
}

.select-search-input {
    margin-bottom: 5px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    padding-left: 38px !important;
}

.options-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 300px;
    background: #1a1a1a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1010;
    overflow-y: auto;
    display: none;
}

.options-dropdown.active {
    display: block;
}

.category-header {
    padding: 10px 12px;
    background: #111111;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
}

.option-item {
    padding: 10px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.option-item:hover {
    background: rgba(30, 144, 255, 0.1);
    color: var(--accent-color);
}

/* Preview de Mídia em Tela Cheia */
.ad-preview-trigger {
    cursor: pointer;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: pointer;
    animation: fadeIn 0.2s ease-out;
}

.preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.fullscreen-media {
    max-width: 95%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    cursor: default;
}

/* Checkbox List for Multi-select */
.checkbox-list {
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    background-color: #111111;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-main);
    border-bottom: 1px solid #f1f5f9;
}

.checkbox-item:last-child { border-bottom: none; }

.checkbox-item input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    cursor: pointer;
    margin: 0;
}

.select-display {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: #111111;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.select-display:hover {
    border-color: var(--accent-color);
}

.select-display::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
}

.checkbox-item.dropdown-item {
    padding: 10px 15px;
}

.table-ad-thumb {
    width: 80px !important;
    height: 45px !important;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.table-ad-thumb i, .table-ad-thumb svg {
    width: 20px !important;
    height: 20px !important;
}

.table-ad-thumb .video-hint {
    padding: 6px;
}

.table-ad-thumb .video-hint i, .table-ad-thumb .video-hint svg {
    width: 12px !important;
    height: 12px !important;
}

.link-copy-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    width: fit-content;
    max-width: 220px;
}

.track-link {
    color: var(--neon-accent);
    font-size: 0.75rem;
    font-family: 'Roboto Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
