/* SeeJH.ai Streams - Shared Styles */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600&family=Montserrat:wght@300;400;500;600&display=swap');

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

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: white;
    min-height: 100vh;
}

/* Base Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

h1 { 
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: -0.02em;
}

h2 { 
    color: rgba(255,255,255,0.9);
    margin: 2rem 0 1rem 0;
    font-size: 1.5rem;
}

p {
    font-size: 1.2rem;
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    background: rgba(0,0,0,0.8);
    color: white;
    border: 1px solid rgba(0,0,0,0.9);
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn:hover { 
    background: rgba(0,0,0,0.9);
    border-color: rgba(0,0,0,1);
    transform: translateY(-2px);
}

.btn-danger { 
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.4);
}

.btn-danger:hover { 
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.6);
}

.btn-success { 
    background: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.4);
}

.btn-success:hover { 
    background: rgba(40, 167, 69, 0.3);
    border-color: rgba(40, 167, 69, 0.6);
}

/* Navigation */
.nav-buttons {
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Messages */
.message { 
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.message.success { 
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.message.error { 
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Forms */
.form-group { 
    margin: 1rem 0; 
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1rem 0;
}

.form-group label { 
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    opacity: 0.9;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    box-sizing: border-box;
    background: rgba(255,255,255,0.1);
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
}

.form-group input::placeholder, .form-group textarea::placeholder {
    color: rgba(255,255,255,0.6);
}

.form-group textarea { 
    min-height: 80px; 
    resize: vertical; 
}

.checkbox-group { 
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.checkbox-group input[type=checkbox] { 
    width: auto;
    accent-color: rgba(255,255,255,0.8);
}

/* Layout Components */
.grid { 
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    margin: 0.5rem 0;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.list-item:hover { 
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

.form-section {
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

/* Form sections inside tab content should connect seamlessly */
.tab-content .form-section {
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
}

.form-section h3 { 
    margin-top: 0;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.confirm-delete {
    background: rgba(255, 243, 205, 0.2);
    border: 1px solid rgba(255, 234, 167, 0.4);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    backdrop-filter: blur(10px);
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.tab {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.2);
    border-bottom: none;
    padding: 12px 24px;
    cursor: pointer;
    margin-right: 4px;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

.tab:hover {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
}

.tab.active {
    background: rgba(255,255,255,0.2);
    color: white;
    border-color: rgba(255,255,255,0.4);
}

.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
}

/* Page-specific styles */
.home-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.home-page .container {
    max-width: 600px;
}

.home-page .logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.admin-page {
    padding: 2rem 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .grid { 
        grid-template-columns: 1fr; 
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        flex: 1;
        min-width: 120px;
        margin-bottom: 4px;
    }
    
    h1 { 
        font-size: 2rem; 
    }
    
    .container { 
        padding: 1rem; 
    }
    
    .nav-buttons { 
        justify-content: stretch; 
    }
    
    .nav-buttons .btn { 
        flex: 1; 
        text-align: center; 
    }
    
    .home-page .logo { 
        font-size: 3rem; 
    }
}

/* Dashboard Overview Cards */
.dashboard-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.overview-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 1.5rem;
    text-align: center;
}

.overview-card .card-header h2 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.overview-card .count {
    font-size: 3rem;
    font-weight: bold;
    color: rgba(255,255,255,0.9);
    margin: 1rem 0;
}

.overview-card p {
    margin-bottom: 1.5rem;
    opacity: 0.7;
    font-size: 1rem;
}

.overview-card .card-actions {
    justify-content: center;
}

/* Grid Layouts for Cameras and Hosts */
.cameras-grid, .hosts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.camera-card, .host-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.camera-card:hover, .host-card:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.camera-card .card-header, .host-card .card-header {
    margin-bottom: 1rem;
}

.camera-card .card-header strong, .host-card .card-header strong {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.95);
}

.camera-card .card-body, .host-card .card-body {
    margin-bottom: 1.5rem;
    min-height: 60px;
}

.camera-card .card-body small, .host-card .card-body small {
    color: rgba(255,255,255,0.6);
    display: block;
    margin-bottom: 0.5rem;
}

.camera-card .card-body p, .host-card .card-body p {
    font-size: 0.9rem;
    margin-bottom: 0;
    opacity: 0.8;
    line-height: 1.4;
}

/* Stream URL styling */
.stream-url {
    margin: 0.5rem 0;
}

.stream-link {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    word-break: break-all;
    display: block;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.stream-link:hover {
    color: rgba(255,255,255,0.9);
    text-decoration: underline;
}

.stream-link.disabled {
    color: rgba(255,255,255,0.4);
    cursor: not-allowed;
}

/* Incomplete streams styling */
.camera-card.incomplete {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.15);
}

.camera-card.incomplete:hover {
    background: rgba(255,255,255,0.1);
}

.incomplete-notice {
    color: rgba(255, 193, 7, 0.8);
    font-size: 0.8rem;
    font-style: italic;
    margin: 0.5rem 0;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.card-actions .btn {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    border: 1px dashed rgba(255,255,255,0.2);
}

.empty-state p {
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

/* Mobile responsiveness for grids */
@media (max-width: 1024px) {
    .cameras-grid, .hosts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-overview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .cameras-grid, .hosts-grid {
        grid-template-columns: 1fr;
    }
    
    .card-actions {
        justify-content: stretch;
    }
    
    .card-actions .btn {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 600px) {
    p { 
        font-size: 1rem; 
    }
}