/* Global Variables */
:root {
    --primary: #b343c9;
    --primary-dark: #9839ab;
    --primary-light: #e1bee7;
    --background-dark: #121212;
    --background-card: #1e1e1e;
    --text-light: #ffffff;
    --text-muted: #bbbbbb;
    --border-color: #333333;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #2196f3;
}

/* Base Styles */
@import url('https://rsms.me/inter/inter.css');

body {
    font-family: Inter var, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", Segoe UI Symbol, "Noto Color Emoji";
    font-feature-settings: normal;
    font-size: 0.875rem;
    background-color: var(--background-dark);
    color: var(--text-light);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    letter-spacing: -0.025em;
    line-height: 1.5;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #0a0a0a;
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-right: 10px;
}

.sidebar-header h1 {
    color: var(--primary);
    font-size: 1.3rem;
    margin: 0;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 2px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-light);
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-nav li.active a {
    background-color: rgba(156, 39, 176, 0.2);
    border-left: 3px solid var(--primary);
}

.sidebar-nav i {
    margin-right: 10px;
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    border-top: 1px solid var(--border-color);
    background-color: #0a0a0a;
}

.sidebar-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-footer li {
    margin: 0;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--text-light);
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar-footer a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-footer i {
    margin-right: 10px;
    font-size: 1.2rem;
    color: var(--primary);
    width: 25px;
    text-align: center;
}

/* Main Content */
.content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.025em;
}

/* Cards */
.card {
    background-color: var(--background-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 15px 20px;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 20px;
}

/* Balance Cards */
.balance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.balance-card {
    padding: 20px;
    border-radius: 8px;
    background-color: var(--background-card);
    border: 1px solid var(--border-color);
}

.balance-card-title {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.balance-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Forms */
.form-control, .form-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Corrige o fundo cinza dos listboxes */
.form-select {
    background-color: var(--background-card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.form-control:focus, .form-select:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(179, 67, 201, 0.25);
    color: var(--text-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    letter-spacing: -0.025em;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
}

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
}

.btn-warning {
    background-color: var(--warning);
    border-color: var(--warning);
}

.btn-danger {
    background-color: var(--danger);
    border-color: var(--danger);
}

.btn-info {
    background-color: var(--info);
    border-color: var(--info);
}

/* Tables */
.table {
    color: var(--text-light);
    border-color: var(--border-color);
    font-size: 0.875rem;
}

.table thead th {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: var(--border-color);
    color: var(--primary);
    font-weight: 600;
    letter-spacing: -0.025em;
}

.table td {
    border-color: var(--border-color);
    vertical-align: middle;
    padding: 0.75rem 1rem;
}

/* Alerts */
.alert {
    border-radius: 12px;
    padding: 12px 15px;
}

.alert-primary {
    background-color: rgba(156, 39, 176, 0.1);
    border-color: var(--primary);
    color: var(--primary-light);
}

/* Webhooks */
.webhook-url {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    margin-bottom: 10px;
    word-break: break-all;
    font-size: 0.875rem;
}

/* Prompt Text */
.prompt-text {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    white-space: pre-line;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875rem;
}

.prompt-text p {
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        overflow: visible;
    }
    
    .sidebar-header h1 {
        display: none;
    }
    
    .sidebar-nav span {
        display: none;
    }
    
    .sidebar-nav a {
        padding: 15px;
        justify-content: center;
    }
    
    .sidebar-nav i {
        margin-right: 0;
    }
    
    .sidebar-footer span {
        display: none;
    }
    
    .sidebar-footer a {
        padding: 15px;
        justify-content: center;
    }
    
    .sidebar-footer i {
        margin-right: 0;
    }
    
    .content {
        margin-left: 60px;
    }
    
    .balance-cards {
        grid-template-columns: 1fr;
    }
}

/* Specific Elements */
.api-key-field {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    letter-spacing: 4px;
}

.refresh-button {
    margin-left: 10px;
    font-size: 0.9rem;
}

.generation-form {
    max-width: 800px;
    margin: 0 auto;
}

/* Audio and video player styles */
audio, video {
    width: 100%;
    margin-bottom: 15px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

/* Modal Styles */
.modal-content {
    background-color: var(--background-card);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.modal-title {
    color: var(--primary);
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%); /* Make the close button white */
}

.close {
    color: var(--text-light);
    text-shadow: none;
}

.close:hover {
    color: var(--text-muted);
}

/* Media card styles */
.media-card {
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.media-card .video-container {
    background-color: #000;
    height: 180px;
    overflow: hidden;
}

.media-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.media-card .card-text {
    font-size: 0.875rem;
    line-height: 1.5;
}

.media-card .badge {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.media-card .card-footer {
    background-color: var(--border-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Video modal */
#videoModal .modal-content {
    background-color: var(--background-card);
}

#videoModal .modal-body {
    padding: 0;
    background-color: #000;
}

#videoModal video {
    width: 100%;
    border-radius: 0;
}

/* Loading spinner styles */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading:after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: calc(50% - 8px);
    left: calc(50% - 8px);
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom Links */
a.voice-link {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a.voice-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.voice-link {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
