@font-face {
    font-family: 'CustomFont';
    src: url('/assets/fonts/beer_money.ttf') format('truetype');
    font-display: swap;
}

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

html, body {
    width: 100%;
    height: 100%;
    background: #e0e0e0;
    font-family: 'Noto Sans', Arial, sans-serif;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Desktop Side Image — starts at middle of phone, 50px top/bottom inset */
#desktop-background {
    display: none;
    position: fixed;
    left: calc(200px + 207px);
    top: 50%;
    transform: translateY(-50%);
    height: calc(896px - 120px);
    right: 60px;
    overflow: hidden;
    border-radius: 0 20px 20px 0;
    z-index: 0;
}

#desktop-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(100%);
    transition: opacity 1s ease;
}

/* Phone Frame Container — everything lives inside this */
#mobile-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 414px;
    max-height: 896px;
    background: #f5f5f5;
    overflow: hidden;
}

/* Tablet/small desktop: phone frame only, centered, no side image */
@media (min-width: 769px) {
    #mobile-container {
        flex-shrink: 0;
        border-radius: 40px;
        border: 8px solid #000;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
        z-index: 1;
    }
}

/* Large desktop: phone left + side image right */
@media (min-width: 1200px) {
    html, body {
        justify-content: flex-start;
        padding-left: 200px;
    }

    #desktop-background {
        display: block;
    }
}

/* App wrapper — fills the phone frame */
#app-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Scale container */
.scale-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Profile Bar — absolute inside phone frame */
.profile-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.profile-picture {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.profile-name {
    color: #000;
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Menu button */
.menu-button {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.menu-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.menu-button svg {
    display: block;
    color: #333;
}

/* Menu items */
.menu-items {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 101;
}

.menu-items.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-items button {
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s;
}

.menu-items button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.menu-items hr {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: 8px 0;
}

.filter-btn {
    font-weight: 600 !important;
}

.filter-btn.active {
    color: #007AFF !important;
}

/* Counter — absolute inside phone frame */
.counter {
    position: absolute;
    top: 62px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    z-index: 99;
}

/* Carousel wrapper — between profile bar and control bar */
.carousel-wrapper {
    width: 100%;
    height: calc(100% - 110px);
    position: absolute;
    top: 55px;
    left: 0;
    overflow: hidden;
}

.carousel-container {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease-out;
}

/* Card styles */
.card {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    position: relative;
    background: #f5f5f5;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-ad-space {
    height: 30px;
    flex-shrink: 0;
    background: #fff;
}

.image-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.background-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.text-container {
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px 40px;
    margin-top: -25%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
    box-sizing: border-box;
}

.text-line {
    font-family: 'CustomFont', Arial, sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    color: #000;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
    margin: 8px 0;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
    letter-spacing: 1px;
}

/* Author bar */
.author-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 20;
}

.author-photo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.author-name {
    color: white;
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    flex-grow: 1;
}

/* Navigation buttons */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    z-index: 20;
    transition: all 0.2s;
    opacity: 0;
    pointer-events: auto;
}

.carousel-wrapper:hover .nav-button {
    opacity: 1;
}

.nav-button:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.nav-prev {
    left: 20px;
}

.nav-next {
    right: 20px;
}

/* Control Bar — absolute inside phone frame */
.fixed-control-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-buttons {
    display: flex;
    gap: 8px;
    flex-grow: 1;
}

.control-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    position: relative;
}

.control-button:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.control-button.active svg {
    fill: #ff3040;
    stroke: #ff3040;
}

.control-button span {
    font-size: 11px;
    color: #333;
    font-weight: 600;
    margin-top: 2px;
    transition: color 0.2s ease;
}

.like-button.active .like-count {
    color: #ff3040;
}

.write-button {
    background: #e0e0e0;
    color: #333;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    cursor: pointer;
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.write-button:hover {
    background: #ccc;
    transform: scale(1.05);
}

.write-button:active {
    transform: scale(0.95);
}

/* Modal — absolute inside phone frame */
.modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 200;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    text-transform: uppercase;
    margin: 0;
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-button:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.text-input {
    width: 100%;
    height: 120px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

.text-input:focus {
    border-color: #007AFF;
}

.char-counter {
    text-align: right;
    margin: 8px 0;
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 12px;
    color: #999;
}

.submit-button {
    width: 100%;
    background: #007AFF;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.submit-button:hover:not(:disabled) {
    background: #0056CC;
    transform: translateY(-2px);
}

.submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Notification toast — absolute inside phone frame */
.notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    z-index: 300;
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Mobile: fill entire viewport, no phone frame */
@media (max-width: 768px) {
    html, body {
        padding-left: 0;
        justify-content: center;
        background: #f5f5f5;
    }

    #mobile-container {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .nav-button {
        display: none;
    }

    .control-button {
        width: 40px;
        height: 40px;
    }

    .write-button {
        padding: 10px 20px;
        font-size: 12px;
    }
}

/* Notification bell */
.notification-bell {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: auto;
    margin-right: 5px;
    color: #333;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.notification-popup {
    display: none;
    position: absolute;
    top: 50px;
    right: 10px;
    width: 300px;
    max-height: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 101;
    overflow: hidden;
}

.notification-popup.show {
    display: block;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.notif-mark-all {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}

.notif-list {
    max-height: 340px;
    overflow-y: auto;
}

.notif-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.notif-item:hover {
    background: #f8f9fa;
}

.notif-item .notif-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.notif-empty {
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 13px;
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-button {
        opacity: 1;
    }

    .control-button:hover,
    .write-button:hover,
    .menu-button:hover {
        transform: none;
    }
}

/* ========== COMMENT PREVIEW ========== */
.comment-preview {
    flex-shrink: 0;
    padding: 6px 15px 10px;
    background: #f5f5f5;
    cursor: pointer;
    pointer-events: auto;
    max-height: 130px;
    overflow: hidden;
}

.comment-preview-link {
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 13px;
    color: #555;
    text-align: center;
    margin-bottom: 10px;
}

.comment-preview-item {
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.comment-preview-item:nth-child(1) { color: #000; }
.comment-preview-item:nth-child(2) { color: #666; }
.comment-preview-item:nth-child(3) { color: #aaa; }

.comment-preview-item strong {
    font-weight: 700;
    margin-right: 4px;
}

/* ========== COMMENTS MODAL ========== */
.comments-modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: white;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.comments-header h3 {
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    margin: 0;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.comment-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 15px;
    gap: 10px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}

.comment-username {
    font-weight: 700;
    font-size: 13px;
    color: #000;
}

.comment-time {
    font-size: 11px;
    color: #999;
}

.comment-text {
    font-size: 14px;
    color: #333;
    line-height: 1.3;
    word-wrap: break-word;
}

.comment-admin-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.comment-delete-btn,
.comment-block-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.comment-delete-btn:hover,
.comment-block-btn:hover {
    opacity: 1;
    background: rgba(0,0,0,0.05);
}

.comment-input-bar {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid #eee;
    gap: 8px;
    flex-shrink: 0;
    background: white;
}

.comment-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
    outline: none;
    font-family: Arial, sans-serif;
}

.comment-input:focus {
    border-color: #007AFF;
}

.comment-send-btn {
    background: #007AFF;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.comment-send-btn:disabled {
    background: #ccc;
}
