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

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #232323;
    --bg-hover: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-tertiary: #808080;
    --accent-primary: #00a8e1;
    --accent-hover: #0095cc;
    --border-color: #2d2d2d;
    --success: #00c853;
    --error: #ff1744;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}


.header {
    position: sticky;
    top: 0;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    transition: var(--transition);
}

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

.logo {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    gap: 12px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.nav-btn.active {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}


.main {
    min-height: calc(100vh - 80px);
    padding: 40px 0;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.view.active {
    display: block;
}

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


.hero {
    text-align: center;
    margin-bottom: 48px;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}


.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto 48px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}


.movies-section {
    margin-top: 48px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.movie-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.movie-info {
    padding: 16px;
}

.movie-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.movie-genre {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 12px;
    color: var(--accent-primary);
    margin-top: 8px;
}


.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state.show {
    display: flex;
}

.empty-state svg {
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
}

.upload-container {
    max-width: 700px;
    margin: 0 auto;
    padding-bottom: 20px;
}

.upload-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
}

.upload-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}


.poster-upload-area {
    position: relative;
    cursor: pointer;
}

.poster-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
    text-align: center;
}

.poster-upload-area:hover .poster-placeholder {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.poster-placeholder svg {
    margin-bottom: 16px;
    color: var(--text-tertiary);
}

.poster-placeholder p {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.poster-placeholder span {
    font-size: 13px;
    color: var(--text-tertiary);
}

.poster-preview {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
}


.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    position: sticky;
    bottom: 0;
    background: var(--bg-secondary);
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    z-index: 10;
}

.btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-primary::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-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 168, 225, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}


.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

.modal.show {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    max-width: 900px;
    max-height: 90vh;
    margin: 5vh auto;
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

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

.modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.modal-header {
    position: relative;
    height: 400px;
    background-size: cover;
    background-position: center;
}

.modal-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--bg-secondary), transparent);
}

.modal-details {
    padding: 32px;
}

.modal-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
}

.modal-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 15px;
    color: var(--text-secondary);
}

.modal-description {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-watch {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-watch:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-delete {
    padding: 16px 24px;
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-delete:hover {
    background: var(--error);
    color: white;
}


.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: transform 0.3s ease-in-out;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}


@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header-content {
        padding: 16px 0;
    }

    .logo {
        font-size: 24px;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 14px;
    }

    .nav-btn svg {
        width: 18px;
        height: 18px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

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

    .movie-info {
        padding: 12px;
    }

    .movie-title {
        font-size: 14px;
    }

    .movie-meta {
        font-size: 12px;
    }

    .upload-form {
        padding: 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

    .modal-content {
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-header {
        height: 300px;
    }

    .modal-title {
        font-size: 28px;
    }

    .modal-details {
        padding: 24px 16px;
    }

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

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }

    .movies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .upload-title {
        font-size: 24px;
    }

    .nav-btn span {
        display: none;
    }
}


.player-modal .modal-content {
    max-width: 1200px;
}

.player-modal-content {
    position: relative;
    max-width: 1200px;
    max-height: 90vh;
    margin: 5vh auto;
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.player-container {
    position: relative;
    width: 100%;
    background: #000;
}

#video-player {
    width: 100%;
    height: auto;
    max-height: 70vh;
    display: block;
}

.player-info {
    padding: 24px 32px;
}

.player-info h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

.player-info p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}


.rating-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.rating-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.stars {
    display: flex;
    gap: 4px;
}

.star {
    cursor: pointer;
    color: var(--text-tertiary);
    transition: var(--transition);
}

.star:hover,
.star.hover {
    color: #ffd700;
    transform: scale(1.1);
}

.star.active {
    color: #ffd700;
}

.rating-value {
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 80px;
}


.movie-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.movie-rating .stars {
    gap: 2px;
}

.movie-rating .star {
    width: 14px;
    height: 14px;
}

.movie-rating-text {
    font-size: 12px;
    color: var(--text-secondary);
}


.ad-section {
    margin-top: 60px;
    margin-bottom: 40px;
}

.ad-container {
    position: relative;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: var(--transition);
}

.ad-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(0, 168, 225, 0.05) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.ad-container:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 8px 32px rgba(0, 168, 225, 0.15);
}

.ad-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ad-content {
    position: relative;
    z-index: 1;
    width: 100%;
    text-align: center;
}

.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
}

.ad-placeholder svg {
    opacity: 0.5;
}

.ad-placeholder h4 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.ad-placeholder p {
    font-size: 14px;
    color: var(--text-tertiary);
    margin: 0;
}


.ad-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.ad-content img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.ad-content iframe {
    width: 100%;
    border: none;
    border-radius: 12px;
}

.comments-section {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.comments-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.comment-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.comment-input,
.comment-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 16px;
    transition: var(--transition);
}

.comment-input:focus,
.comment-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

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

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: var(--transition);
}

.comment-item:hover {
    border-color: var(--accent-primary);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.comment-info {
    display: flex;
    flex-direction: column;
}

.comment-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-date {
    font-size: 13px;
    color: var(--text-tertiary);
}

.comment-delete {
    padding: 8px 16px;
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: none;
}

.comment-delete.show {
    display: block;
}

.comment-delete:hover {
    background: var(--error);
    color: white;
}

.comment-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.login-modal-content {
    max-width: 450px;
}

.login-container {
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header svg {
    color: var(--accent-primary);
    margin-bottom: 16px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.btn-block {
    width: 100%;
}


.aws-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.aws-info svg {
    color: var(--accent-primary);
    flex-shrink: 0;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--accent-primary);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 12px;
}

@media (max-width: 768px) {
    .ad-section {
        margin-top: 40px;
        margin-bottom: 30px;
    }

    .ad-container {
        padding: 24px;
        min-height: 200px;
    }

    .ad-placeholder h4 {
        font-size: 18px;
    }

    .ad-placeholder p {
        font-size: 13px;
    }

    .comments-section {
        margin-top: 60px;
        padding-top: 32px;
    }

    .comment-form {
        padding: 20px;
    }

    .comment-item {
        padding: 16px;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .comment-delete {
        align-self: flex-end;
    }

    .login-container {
        padding: 24px;
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

.modal-content::-webkit-scrollbar {
    width: 12px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 6px;
    border: 2px solid var(--bg-secondary);
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(4px);
    }
}

.upload-container p svg {
    animation: scrollBounce 2s ease-in-out infinite;
}

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

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-primary:disabled::before {
    display: none;
}

/* Form Progress Indicator */
#form-progress {
    transition: all 0.3s ease;
    font-weight: 500;
}

#form-progress span {
    display: inline-block;
}
