:root {
    --film-black: #fefefe;
    --film-gray: #f0f0f0;
    --perforation-color: #eee;
    --text-white: #333;
    --accent-color: #F24E90;
    /* Vibrant modern accent - Pink/Magenta */
    --font-main: 'Outfit', sans-serif;
}

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

body {
    background-color: #ffffff;
    color: var(--text-white);
    font-family: var(--font-main);
    padding: 0;
    position: relative;
    overflow-x: hidden;
}

.navbar {
    z-index: 1050;
    /* Higher than filmstrip container */
}

/* Texture removed */

h1 {
    font-weight: 300;
    letter-spacing: 0.4rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(242, 78, 144, 0.1);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s;
}

a:hover {
    color: #d13d7a;
}

.btn-outline-dark {
    border-color: var(--accent-color) !important;
    color: var(--accent-color) !important;
    transition: all 0.3s !important;
}

.btn-outline-dark:hover {
    background-color: var(--accent-color) !important;
    color: #fff !important;
    border-color: var(--accent-color) !important;
}

.container {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Filmstrip Container */
.filmstrip-container {
    display: flex;
    flex-direction: row;
    /* Desktop horizontal */
    background-color: #222;
    padding: 60px 20px;
    border-radius: 4px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    gap: 15px;
    margin-bottom: 2rem;
    border: 1px solid #111;
}

/* Perforations */
.filmstrip-container::before,
.filmstrip-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 25px;
    background-image: radial-gradient(circle, #fff 40%, transparent 45%);
    background-size: 40px 40px;
    background-position: center;
    z-index: 2;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}

.filmstrip-container::before {
    top: 15px;
}

.filmstrip-container::after {
    bottom: 15px;
}

/* Frame */
.frame {
    flex: 0 0 240px;
    height: 320px;
    background: #000;
    border: 1px solid #333;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.frame:hover {
    transform: scale(1.05) rotate(1deg);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    filter: contrast(1.05) saturate(1.1);
}

.view-mode .frame img,
.frame.loaded img {
    display: block !important;
}

.view-mode .frame .frame-instructions,
.frame.loaded .frame-instructions {
    display: none !important;
}

.frame .frame-instructions {
    color: #fff;
    text-align: center;
    padding: 20px;
    transition: all 0.3s;
    z-index: 5;
    position: relative;
    pointer-events: none;
    /* Allow clicks to pass through to the file input */
}

.frame:hover .frame-instructions {
    color: #fff;
}

.frame .frame-instructions i {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
    opacity: 1;
    color: #fff !important;
}

.frame .frame-instructions span {
    display: block;
    font-size: 0.9rem;
    line-height: 1.4;
    font-weight: 300;
    opacity: 1;
    color: #fff !important;
}

.frame .frame-instructions small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 5px;
}

.frame input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Loaded state */
.frame.loaded {
    border: 1px solid #eee;
}

.frame.loaded:hover {
    transform: scale(1.05);
}

/* Frame Wrapper for Creator */
.frame-wrapper {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.frame-caption-input {
    background: #333 !important;
    border: 1px solid #444;
    color: #fff !important;
    padding: 8px;
    font-size: 0.8rem;
    text-align: center;
    border-radius: 4px;
    transition: all 0.3s;
    -webkit-appearance: none;
    appearance: none;
    /* Fix for iOS */
}

.frame-caption-input:focus {
    outline: none;
    border-color: var(--accent-color);
    color: #fff !important;
    background: #444 !important;
}

.frame-caption-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Caption Section */
.controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    align-items: center;
}

.caption-input {
    background: #222;
    border: 1px solid #333;
    color: #fff;
    padding: 12px 20px;
    font-size: 1rem;
    text-align: center;
    transition: all 0.3s;
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
}

.caption-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: #333;
    box-shadow: 0 5px 15px rgba(242, 78, 144, 0.2);
}

.caption-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.submit-btn {
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    padding: 10px 25px;
    font-size: 0.95rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(242, 78, 144, 0.2);
}

.submit-btn:hover {
    background-color: #d13d7a;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(242, 78, 144, 0.3);
}

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

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 40px;
    border-radius: 12px;
    width: 90%;
    max-width: 1100px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
}

#filmStripPreview {
    box-shadow: none;
    border: 1px solid #eee;
}

/* Gallery Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
}

.gallery-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-color);
}

.mini-strip {
    display: flex;
    gap: 4px;
    background: #222;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #111;
}

.mini-frame {
    flex: 1;
    aspect-ratio: 3/4;
    background: #000;
    overflow: hidden;
    border-radius: 2px;
}

.mini-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Ensure visibility */
}

.gallery-caption {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Viewer Specific Styles */
.view-mode .frame-wrapper {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.view-mode .frame {
    cursor: default;
}

.view-mode .frame:hover {
    transform: none;
}

.frame-caption {
    font-size: 1rem;
    color: #fff;
    font-style: italic;
    text-align: center;
    max-width: 240px;
    line-height: 1.4;
}

.share-controls {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.share-btn {
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.share-btn:hover {
    background: #444;
    color: white;
}

.share-btn.twitter {
    background: #000;
}

.share-btn.whatsapp {
    background: #25D366;
}

.share-btn.secondary {
    background: #f0f0f0;
    color: #666;
}

.share-btn.secondary:hover {
    background: #e5e5e5;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .filmstrip-container {
        flex-direction: column;
        /* Mobile vertical */
        padding: 10px 40px;
        align-items: center;
    }

    .filmstrip-container::before,
    .filmstrip-container::after {
        width: 15px;
        height: 100%;
        background-size: 30px 30px;
        top: 0;
        bottom: 0;
    }

    .filmstrip-container::before {
        left: 12px;
        right: auto;
    }

    .filmstrip-container::after {
        right: 12px;
        left: auto;
    }

    .frame {
        width: 100%;
        max-width: 300px;
        height: 250px;
    }

    .navbar-collapse {
        margin-top: 15px;
        padding-bottom: 10px;
    }

    .navbar-collapse .ms-auto {
        flex-direction: column;
        gap: 12px !important;
        align-items: center;
    }
}

/* Global Tag Styling */
.hover-pink:hover {
    color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
}

.gallery-item-wrapper {
    transition: transform 0.3s;
}

.gallery-item-wrapper:hover {
    transform: translateY(-5px);
}