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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    opacity: 0.9;
    margin-bottom: 20px;
}

nav {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.3);
}

.nav-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

.section {
    display: none;
    padding: 30px;
}

.section.active {
    display: block;
}

.section h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-card h3 {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    margin: 10px 0;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.info-card {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.info-card strong {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

/* Actions */
.actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    background: #e0e0e0;
    color: #333;
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

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

.btn-secondary:hover {
    background: #45a049;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1em;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Controls */
.controls {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.controls select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

/* Images Grid */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.image-card {
    background: #f5f5f5;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
    position: relative;
}

.image-card:hover {
    transform: scale(1.05);
}

.delete-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    border-radius: 50%;
    background: rgba(244, 67, 54, 0.9);
    color: white;
    border: 2px solid white;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-image-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.image-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.image-card .image-info {
    padding: 10px;
    font-size: 0.9em;
}

.image-card .image-time {
    font-weight: bold;
    color: #667eea;
}

.image-card .image-size {
    color: #666;
    font-size: 0.8em;
}

/* Videos List */
.videos-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-card {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.video-card h3 {
    color: #333;
    margin-bottom: 10px;
}

.video-info {
    display: flex;
    gap: 20px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.video-info span {
    background: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.9em;
}

.video-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.video-actions video {
    width: 100%;
    max-width: 600px;
    margin-top: 10px;
    border-radius: 5px;
}

/* Forms */
.create-form, .settings-form {
    max-width: 600px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

.form-group input[type="radio"] {
    margin-right: 10px;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

.alert.hidden {
    display: none;
}

.alert.info {
    background: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #1976d2;
}

.alert.success {
    background: #e8f5e9;
    color: #388e3c;
    border-left: 4px solid #388e3c;
}

.alert.error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.alert.warning {
    background: #fff3e0;
    color: #f57c00;
    border-left: 4px solid #f57c00;
}

/* System Info */
.system-info {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 5px;
    margin-top: 20px;
}

.system-info h3 {
    margin-bottom: 15px;
    color: #333;
}

.system-info p {
    margin: 10px 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 5px;
}

.close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

#modal-info {
    color: white;
    text-align: center;
    margin-top: 10px;
}

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

    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .actions {
        flex-direction: column;
    }

    .actions .btn {
        width: 100%;
    }
}
