@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #06050c;
    --bg-card: rgba(20, 18, 38, 0.45);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-focus: rgba(168, 85, 247, 0.4);
    --color-primary: #a855f7;
    --color-primary-rgb: 168, 85, 247;
    --color-secondary: #ec4899;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --sidebar-width: 260px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Gradients */
body::before, body::after {
    content: '';
    position: fixed;
    width: 60vw;
    height: 60vh;
    border-radius: 50%;
    z-index: -1;
    filter: blur(130px);
    opacity: 0.25;
    pointer-events: none;
}

body::before {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.8) 0%, transparent 70%);
    top: -20vh;
    left: -10vw;
    animation: floatGlow 15s infinite alternate ease-in-out;
}

body::after {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.8) 0%, transparent 70%);
    bottom: -20vh;
    right: -10vw;
    animation: floatGlow 20s infinite alternate-reverse ease-in-out;
}

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5vw, 5vh) scale(1.1); }
}

/* Glassmorphism Styles */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Login Page Container */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.login-header h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(90deg, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

.login-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
}

.login-logo svg {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.5));
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.form-control {
    width: 100%;
    padding: 12px 16px 12px 46px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-glass-focus);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.15);
}

.form-control:focus + svg {
    color: var(--color-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger), #dc2626);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success), #059669);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-icon {
    padding: 8px;
    border-radius: 8px;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-glass);
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-left: 10px;
}

.sidebar-brand h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(90deg, #fff, var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-brand svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.5));
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: var(--transition-fast);
    cursor: pointer;
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
}

.sidebar-link:hover, .sidebar-link.active {
    color: #fff;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.1);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-glass);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.content-header h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
}

.content-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Toast Message */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(150%);
    transition: transform var(--transition-smooth);
    z-index: 9999;
}

.toast.show {
    transform: translateY(0);
}

.toast-success {
    background: rgba(16, 185, 129, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.toast-error {
    background: rgba(239, 68, 68, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

.toast-info {
    background: rgba(168, 85, 247, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 25px rgba(168, 85, 247, 0.3);
}

/* Tabs Content */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Transmissões Section */
.streams-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state h3 {
    color: #fff;
    margin-bottom: 8px;
    font-family: var(--font-heading);
}

/* Stream Card */
.stream-card {
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stream-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stream-info h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.stream-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stream-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    font-size: 0.85rem;
}

.stream-badge {
    padding: 4px 10px;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.badge-draft { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-live { background: rgba(16, 185, 129, 0.15); color: var(--color-success); border: 1px solid rgba(16, 185, 129, 0.3); animation: pulseGreen 2s infinite; }
.badge-finished { background: rgba(156, 163, 175, 0.15); color: var(--text-muted); border: 1px solid rgba(156, 163, 175, 0.3); }

@keyframes pulseGreen {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.stream-actions {
    display: flex;
    gap: 12px;
}

/* Destinos Grid */
.destinations-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    border-top: 1px solid var(--border-glass);
    padding-top: 20px;
}

.destination-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 16px;
}

.destination-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.destination-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.destination-title svg {
    width: 20px;
    height: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.dot.online { background-color: var(--color-success); box-shadow: 0 0 8px var(--color-success); }
.dot.offline { background-color: var(--color-danger); }
.dot.waiting { background-color: var(--color-warning); animation: pulseWarning 1.5s infinite; }

@keyframes pulseWarning {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Key Ingest details */
.ingest-detail {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.copy-input-group {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    overflow: hidden;
}

.copy-input-group input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: monospace;
    font-size: 0.8rem;
    padding: 8px 12px;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-left: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 8px 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-copy:hover {
    color: #fff;
    background: rgba(168, 85, 247, 0.1);
}

.btn-copy svg {
    width: 16px;
    height: 16px;
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 5, 12, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    width: 100%;
    max-width: 600px;
    padding: 32px;
    transform: scale(0.9);
    transition: transform var(--transition-smooth);
}

.modal-backdrop.show .modal-window {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-close svg {
    width: 24px;
    height: 24px;
}

/* Platform Selectors */
.platform-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.platform-checkbox {
    position: relative;
    cursor: pointer;
}

.platform-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.platform-design {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition-fast);
}

.platform-design svg {
    width: 24px;
    height: 24px;
}

.platform-checkbox input:checked + .platform-design {
    background: rgba(168, 85, 247, 0.15);
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.1);
}

/* Credentials Configuration Form */
.config-container {
    max-width: 900px;
}

.config-card {
    padding: 24px;
    margin-bottom: 24px;
}

.config-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 12px;
}

.config-card-header svg {
    width: 24px;
    height: 24px;
    color: var(--color-primary);
}

.config-card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
}

.sandbox-toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    margin-bottom: 30px;
}

.sandbox-info h3 {
    font-size: 1rem;
    font-family: var(--font-heading);
    margin-bottom: 4px;
}

.sandbox-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--border-glass);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: var(--color-primary);
}

.switch input:checked + .slider:before {
    transform: translateX(24px);
}

/* Colors for specific platforms */
.yt-color { color: #ff0000; fill: #ff0000; }
.fb-color { color: #1877f2; fill: #1877f2; }
.ig-color { color: #e1306c; fill: #e1306c; }
.tt-color { color: #00f2fe; fill: #00f2fe; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
        padding: 20px;
    }
    
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .sidebar-brand {
        margin-bottom: 20px;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .platform-selector {
        grid-template-columns: 1fr;
    }
}
