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

:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --error: #ef4444;
    --cyan: #06b6d4;
    --pink: #ec4899;
    --bg-main: #0f0a1e;
    --bg-card: #1a1332;
    --bg-hover: #2d1f4d;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --border: #3730a3;
    --shadow: rgba(0, 0, 0, 0.4);
    --glow: rgba(139, 92, 246, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, rgba(26, 19, 50, 0.95) 0%, rgba(55, 48, 163, 0.2) 100%);
    backdrop-filter: blur(10px);
    padding: 30px 0;
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
    margin-bottom: 0;
    border-bottom: 2px solid rgba(139, 92, 246, 0.2);
}

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

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    animation: gradientShift 3s ease infinite;
    background-size: 200% auto;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.tagline {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.btn-logout {
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);
    border: 2px solid rgba(239, 68, 68, 0.4);
    border-radius: 12px;
    color: #fca5a5;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.btn-logout:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);
    border-color: var(--error);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Tabs */
.tabs {
    background: linear-gradient(135deg, rgba(26, 19, 50, 0.95) 0%, rgba(55, 48, 163, 0.15) 100%);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    padding: 0;
    margin-bottom: 40px;
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2);
}

.tabs .container {
    display: flex;
    gap: 0;
}

.tab-btn {
    flex: 1;
    padding: 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tab-btn.active {
    color: #a78bfa;
    border-bottom-color: #8b5cf6;
    background: linear-gradient(to top, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.05));
    position: relative;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8b5cf6 0%, #ec4899 100%);
    box-shadow: 0 2px 15px rgba(139, 92, 246, 0.5);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

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

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

/* Card */
.card {
    background: linear-gradient(135deg, rgba(26, 19, 50, 0.95) 0%, rgba(55, 48, 163, 0.2) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.3);
    margin-bottom: 30px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    animation: cardGlow 4s ease-in-out infinite;
}

@keyframes cardGlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20%, -20%); }
}

.card h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.description {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Forms */
.upload-form {
    max-width: 600px;
    margin: 0 auto;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-field {
    width: 100%;
    padding: 14px 18px;
    background: rgba(15, 10, 30, 0.5);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.input-field:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2), 0 8px 20px rgba(139, 92, 246, 0.3);
    background: rgba(15, 10, 30, 0.8);
    transform: translateY(-2px);
}

/* File Input */
.file-input-wrapper {
    margin-bottom: 25px;
    position: relative;
    isolation: isolate;
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.file-input-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    background: var(--bg-main);
    border: 2px dashed var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
    pointer-events: none;
}

.file-input-wrapper:hover .file-input-label {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.file-input-icon {
    font-size: 1.5rem;
}

/* Preview */
.preview {
    margin-bottom: 25px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-main);
    padding: 10px;
}

.preview img,
.preview video {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
}

/* Buttons */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(139, 92, 246, 0.6);
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    justify-content: center;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
}

/* Gallery */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, rgba(26, 19, 50, 0.95) 0%, rgba(55, 48, 163, 0.2) 100%);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.count-badge {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
    margin-bottom: 40px;
    background: linear-gradient(135deg, rgba(26, 19, 50, 0.6) 0%, rgba(55, 48, 163, 0.1) 100%);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 20px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.media-item {
    background: var(--bg-main);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    aspect-ratio: 1 / 1;
    border: 2px solid transparent;
}

.media-item:hover {
    transform: scale(0.97) translateY(-4px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.4);
    z-index: 10;
}

.media-item:active {
    transform: scale(0.94);
}

.delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5);
}

.media-item:hover .delete-btn {
    opacity: 1;
    animation: bounceIn 0.4s;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.delete-btn:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 1) 0%, rgba(220, 38, 38, 1) 100%);
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.7);
}

.delete-btn:active {
    transform: scale(0.9);
}

.media-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--bg-main);
    display: block;
}

.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-thumbnail-wrapper canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 1.5rem;
    opacity: 0.95;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9) 0%, rgba(124, 58, 237, 0.9) 100%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.5);
    transition: all 0.3s;
}

.media-item:hover .play-overlay {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.7);
}

.media-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

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

.media-item-title {
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-item-meta {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.7rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.media-type-badge {
    display: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, rgba(26, 19, 50, 0.98) 0%, rgba(55, 48, 163, 0.3) 100%);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    box-shadow: 0 25px 80px rgba(139, 92, 246, 0.5);
    animation: modalSlideIn 0.3s;
    border: 2px solid rgba(139, 92, 246, 0.3);
}

@keyframes modalSlideIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.password-modal {
    max-width: 480px;
    width: 90%;
    margin: 20px;
    animation: modalBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalBounce {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.modal-header {
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
}

/* Upload Progress Modal */
.upload-progress-modal {
    max-width: 500px;
    width: 90%;
    background: linear-gradient(135deg, rgba(26, 19, 50, 0.98) 0%, rgba(55, 48, 163, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(139, 92, 246, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(139, 92, 246, 0.3);
    text-align: center;
}

.upload-progress-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.upload-icon {
    font-size: 4rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: rgba(15, 10, 30, 0.6);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(139, 92, 246, 0.3);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8b5cf6 0%, #ec4899 50%, #f59e0b 100%);
    background-size: 200% 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
    animation: progressShimmer 2s linear infinite;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
}

@keyframes progressShimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.progress-text {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.progress-size {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.btn-cancel {
    margin-top: 10px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);
    border: 2px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    padding: 12px 30px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.poem-modal {
    max-width: 650px;
    width: 95%;
    max-height: 90vh;
    box-shadow: 0 25px 100px rgba(139, 92, 246, 0.6);
    border: 2px solid rgba(139, 92, 246, 0.3);
}

.poem-content {
    padding: 35px;
    background: linear-gradient(135deg, rgba(26, 19, 50, 0.98) 0%, rgba(55, 48, 163, 0.4) 100%);
    position: relative;
}

.poem-content::before {
    content: '"';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 120px;
    color: rgba(139, 92, 246, 0.15);
    font-family: Georgia, serif;
    line-height: 1;
}

.poem-content::after {
    content: '"';
    position: absolute;
    bottom: 20px;
    right: 30px;
    font-size: 120px;
    color: rgba(139, 92, 246, 0.15);
    font-family: Georgia, serif;
    line-height: 1;
}

.poem-content h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 25px;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.poem-scroll {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 15px;
    line-height: 2.2;
    text-align: left;
}

.poem-scroll::-webkit-scrollbar {
    width: 10px;
}

.poem-scroll::-webkit-scrollbar-track {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 10px;
}

.poem-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.poem-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
}

.poem-scroll p {
    color: #e2e8f0;
    font-size: 1.05rem;
    margin-bottom: 12px;
    text-align: left;
    line-height: 2;
    font-family: 'Georgia', serif;
    opacity: 0.95;
    transition: all 0.3s;
    padding-left: 10px;
    border-left: 2px solid transparent;
}

.poem-scroll p:hover {
    opacity: 1;
    border-left-color: rgba(139, 92, 246, 0.5);
    padding-left: 15px;
    color: #f1f5f9;
}

.poem-scroll .highlight {
    color: #a78bfa;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 25px 0;
    text-align: center;
    padding: 15px 20px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2);
    animation: highlightPulse 2s ease-in-out infinite;
}

@keyframes highlightPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2); }
    50% { transform: scale(1.02); box-shadow: 0 12px 40px rgba(139, 92, 246, 0.4); }
}

.poem-scroll .ending {
    color: #fca5a5;
    font-weight: 800;
    font-size: 1.4rem;
    margin: 30px 0;
    text-align: center;
    padding: 20px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 12px;
    border: 2px solid rgba(239, 68, 68, 0.4);
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    animation: endingBlink 1.5s ease-in-out infinite;
}

@keyframes endingBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.poem-scroll .author {
    color: #cbd5e1;
    font-style: italic;
    text-align: right;
    margin-top: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 15px 20px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 10px;
    border-left: 4px solid #8b5cf6;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
}

.powered-by {
    margin: 0;
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
}

.highlight-text {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    display: inline-block;
}

.highlight-text:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.modal-body .input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.modal-body .input-group .input-field {
    width: 100%;
}

.modal-body .input-group .btn {
    width: 100%;
    justify-content: center;
}

.media-modal {
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

#mediaContainer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-main);
    min-height: 200px;
    max-height: calc(95vh - 150px);
}

#mediaContainer img,
#mediaContainer video {
    max-width: 100%;
    max-height: 65vh;
    width: auto;
    height: auto;
    object-fit: contain;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.media-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 200px;
    color: var(--text-secondary);
}

.media-loading .spinner {
    margin: 0;
}

.media-info {
    padding: 25px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    max-height: 40vh;
    overflow-y: auto;
}

/* Messages */
.status-message,
.error-message {
    margin-top: 15px;
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 500;
    text-align: center;
    min-height: 20px;
}

.error-message {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    border: 1px solid var(--error);
}

.error-message:empty {
    display: none;
}

.status-message.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    border: 1px solid var(--error);
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top-color: #8b5cf6;
    border-right-color: #ec4899;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, rgba(26, 19, 50, 0.95) 0%, rgba(55, 48, 163, 0.2) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.2);
    animation: fadeIn 0.5s;
}

.empty-state p:first-child {
    font-size: 5rem;
    margin-bottom: 20px;
}

.empty-state p:nth-child(2) {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-subtitle {
    color: var(--text-secondary);
}

/* Utility */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }

    .header-content {
        flex-direction: row;
        gap: 15px;
    }

    .btn-logout {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .card {
        padding: 25px;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 3px;
        padding: 3px;
    }

    .gallery-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .tab-btn {
        font-size: 0.9rem;
        padding: 15px 10px;
    }

    .modal-header {
        padding: 25px 20px;
    }

    .modal-header h2 {
        font-size: 1.75rem;
    }

    .poem-trigger {
        font-size: 0.95rem;
        padding: 10px 24px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 15px 20px;
    }

    .powered-by {
        font-size: 0.85rem;
    }

    .password-modal {
        width: 95%;
        margin: 10px;
    }

    .poem-modal {
        width: 95%;
        max-height: 90vh;
    }

    .poem-content {
        padding: 20px;
    }

    .poem-content h2 {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }

    .poem-scroll {
        max-height: 65vh;
        padding-right: 10px;
    }

    .poem-scroll p {
        font-size: 1rem;
    }

    .poem-scroll .highlight {
        font-size: 1.1rem;
        padding: 12px 15px;
    }

    .poem-scroll .ending {
        font-size: 1.2rem;
        padding: 15px;
    }

    .card {
        padding: 20px;
    }

    .card h2 {
        font-size: 1.5rem;
    }

    .description {
        font-size: 1rem;
    }

    .gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
        padding: 3px;
    }

    .gallery-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 15px 20px;
    }

    .gallery-header h2 {
        font-size: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .header-content > div {
        width: 100%;
    }

    .btn-logout {
        padding: 8px 16px;
        font-size: 0.85rem;
        align-self: center;
    }

    .logo {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.85rem;
    }

    .btn-logout {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .tab-btn {
        font-size: 0.8rem;
        padding: 12px 5px;
    }

    .modal-header {
        padding: 20px 15px;
    }

    .modal-header h2 {
        font-size: 1.4rem;
    }

    .poem-trigger {
        font-size: 0.9rem;
        padding: 8px 20px;
    }

    .modal-footer {
        padding: 12px 15px;
    }

    .powered-by {
        font-size: 0.8rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .btn-full,
    .btn-large {
        padding: 14px 20px;
        font-size: 1rem;
    }

    .card {
        padding: 20px 15px;
    }

    .card h2 {
        font-size: 1.3rem;
    }

    .gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
        padding: 2px;
    }

    .gallery-header {
        padding: 12px 15px;
    }

    .gallery-header h2 {
        font-size: 1.3rem;
    }

    .media-modal {
        width: 98%;
        max-height: 90vh;
        margin: 0;
        padding: 15px;
    }

    #mediaContainer {
        max-height: 50vh;
        min-height: 150px;
    }
    
    #mediaContainer img,
    #mediaContainer video {
        max-height: 50vh;
    }

    .media-info {
        padding: 15px;
        font-size: 0.9rem;
    }

    .media-info h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .media-info > div {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .close-btn {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
        top: 10px;
        right: 10px;
    }

    .play-overlay {
        font-size: 1.2rem;
        width: 28px;
        height: 28px;
        bottom: 6px;
        right: 6px;
    }

    .poem-modal {
        width: 98%;
        max-height: 95vh;
    }

    .poem-content {
        padding: 15px;
    }

    .poem-content {
        padding: 20px 15px;
    }

    .poem-content::before,
    .poem-content::after {
        font-size: 80px;
    }

    .poem-content h2 {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }

    .poem-scroll {
        max-height: 70vh;
        padding-right: 8px;
    }

    .poem-scroll p {
        font-size: 0.95rem;
        line-height: 1.9;
    }

    .poem-scroll .highlight {
        font-size: 1rem;
        padding: 10px 12px;
    }

    .poem-scroll .ending {
        font-size: 1.15rem;
        padding: 12px;
    }

    .poem-scroll .author {
        font-size: 1rem;
        padding: 12px 15px;
    }
}

