/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Navbar */
.navbar {
    background: #1a1a2e;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand a {
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #4361ee;
    color: #fff;
}

.btn-primary:hover {
    background: #3a56d4;
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-secondary:hover {
    background: #dee2e6;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

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

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input[type="radio"],
.form-group input[type="checkbox"] {
    width: auto;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="url"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4361ee;
}

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

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-card {
    background: #fff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-card h1 {
    text-align: center;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.login-card .subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 2rem;
}

/* Dashboard */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    color: #1a1a2e;
}

.back-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.back-link:hover {
    color: #4361ee;
}

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

.group-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.group-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.group-header h3 {
    font-size: 1.1rem;
    color: #1a1a2e;
}

.badge {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.group-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.group-meta {
    color: #adb5bd;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.empty-state h2 {
    margin-bottom: 0.5rem;
    color: #495057;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1.25rem;
    color: #1a1a2e;
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1rem;
    color: #495057;
    margin-bottom: 0.75rem;
}

.card hr {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 1.5rem 0;
}

/* Edit Page */
.edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .edit-grid {
        grid-template-columns: 1fr;
    }
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #4361ee;
    background: rgba(67, 97, 238, 0.05);
}

.drop-zone-content {
    color: #6c757d;
}

.drop-zone-content svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.drop-zone-content .small {
    font-size: 0.85rem;
    color: #adb5bd;
}

.help-text {
    font-size: 0.8rem;
    color: #adb5bd;
    margin-top: 0.75rem;
}

.processing-info {
    color: #4361ee;
    font-style: italic;
}

/* Upload Progress */
.upload-progress {
    margin-top: 1rem;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.upload-item .filename {
    flex: 1;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-item .progress-bar {
    width: 100px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.upload-item .progress-fill {
    height: 100%;
    background: #4361ee;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-item.processing .progress-fill {
    background: #ffc107;
    width: 100%;
    animation: pulse 1s ease-in-out infinite;
}

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

.upload-item .status {
    font-size: 0.75rem;
    color: #6c757d;
}

.upload-item.complete .status {
    color: #28a745;
}

.upload-item.error .status {
    color: #dc3545;
}

/* Media Grid */
.media-section {
    margin-top: 1.5rem;
}

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

.media-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    cursor: grab;
}

.media-item:active {
    cursor: grabbing;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

.media-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 2rem 0.5rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.media-item:hover .media-overlay {
    opacity: 1;
}

.media-name {
    color: #fff;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.btn-delete {
    background: #dc3545;
    color: #fff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    background: #c82333;
}

/* QR Section */
.qr-section {
    text-align: center;
}

.qr-section p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.qr-section .btn {
    margin: 0.25rem;
}

/* Danger Zone */
.danger-zone {
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 1rem;
    background: rgba(220, 53, 69, 0.05);
}

/* Form Page */
.form-page {
    max-width: 600px;
}

.form-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
