/* StockHype Dashboard - Dark Theme */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #e2e8f0;
    background: #0f172a;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s, transform 0.2s;
    font-weight: 500;
}

.nav-menu a:hover {
    color: #60a5fa;
    transform: translateY(-1px);
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > a {
    padding-bottom: 1rem;
    margin-bottom: -0.5rem;
}

.nav-dropdown > a::after {
    content: ' ▾';
    font-size: 0.75rem;
}

.nav-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 8px;
    min-width: 180px;
    padding: 0.5rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    list-style: none;
}

/* Bridge the gap between trigger and menu */
.nav-dropdown .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.nav-dropdown .dropdown-menu li {
    padding: 0;
}

.nav-dropdown .dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: #cbd5e1;
}

.nav-dropdown .dropdown-menu a:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

/* Nav User */
.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(51, 65, 85, 0.5);
}

.nav-user .user-name {
    color: #94a3b8;
    font-size: 0.875rem;
}

.btn-logout {
    padding: 0.375rem 0.75rem;
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5 !important;
    border-radius: 6px;
    font-size: 0.875rem;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171 !important;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 20px;
}

h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #f1f5f9;
    font-weight: 700;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #e2e8f0;
    font-weight: 600;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: 4px solid;
    backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: #6ee7b7;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #fca5a5;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    border: 1px solid rgba(51, 65, 85, 0.5);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.stat-card h3 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.stat-card p {
    color: #94a3b8;
    font-size: 1rem;
    font-weight: 500;
}

/* Section */
.section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    border: 1px solid rgba(51, 65, 85, 0.5);
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background: #1e293b;
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.video-thumbnail {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.video-info {
    padding: 1rem;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

.video-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.video-card h3 a {
    color: #f1f5f9;
    text-decoration: none;
    transition: color 0.3s;
}

.video-card h3 a:hover {
    color: #60a5fa;
}

.video-meta {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.video-meta .author {
    font-weight: 500;
    color: #cbd5e1;
}

.video-meta .date {
    margin-left: 1rem;
}

.video-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Channel List */
.channel-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.channel-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 12px;
    background: #1e293b;
    transition: background 0.3s, border-color 0.3s, transform 0.3s;
}

.channel-item:hover {
    background: #334155;
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateX(4px);
}

.channel-item h4 {
    margin-bottom: 0.25rem;
}

.channel-item h4 a {
    color: #f1f5f9;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.channel-item h4 a:hover {
    color: #60a5fa;
}

.channel-meta {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* Forms */
.edit-form, .add-form {
    max-width: 600px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(51, 65, 85, 0.5);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #e2e8f0;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: #0f172a;
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 8px;
    font-size: 1rem;
    color: #e2e8f0;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input:disabled {
    background: #1e293b;
    cursor: not-allowed;
    opacity: 0.6;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #94a3b8;
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-sm {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: #334155;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    white-space: nowrap;
}

.btn-sm:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
}

.btn-sm.btn-secondary {
    background: #334155;
}

.btn-sm.btn-secondary:hover {
    background: #475569;
}

.btn-link {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.btn-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
}

.empty-state a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.empty-state a:hover {
    color: #93c5fd;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.toast.hiding {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast-message {
    flex: 1;
}

.toast-action {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
}

.toast-action:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: scale(1.05);
}

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        gap: 1rem;
        font-size: 0.875rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
    }
}
