/* ============================================================================
   GIVEAWAY PAGE STYLES
   Glassmorphism design for giveaway gallery page
   ============================================================================ */

/* Background Image */
.giveaway-bg {
    background-image: url('pics/giveaway.jpg');
}

/* Mobile background (different image) */
@media (max-width: 480px) {
    .giveaway-bg {
        background-image: url('pics/giveaway.jpg');
        /* Can use different mobile image if needed */
    }
}

/* Tool Container - Full viewport height with flexbox centering */
.tool-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 40px;
}

/* Main Tool Card - Glassmorphism */
.tool-card {
    background: rgba(15, 25, 40, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    padding: 40px;
    max-width: 900px;
    width: 100%;
}

/* Header Section */
.tool-header {
    text-align: center;
    margin-bottom: 32px;
}

.tool-header h1 {
    font-size: 42px;
    font-weight: 600;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.95);
}

.tool-description {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

/* Upload Section */
.upload-section {
    margin-bottom: 40px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* File Input Styling */
.upload-controls {
    margin-bottom: 20px;
}

.file-input-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 14px 28px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.file-input-label:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.3);
}

.camera-icon {
    font-size: 24px;
}

#imageInput {
    display: none;
}

/* Image Preview */
.image-preview {
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-preview img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    display: block;
}

/* Description Container */
.description-container {
    margin-bottom: 20px;
}

.description-container label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 500;
}

#descriptionInput {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
}

#descriptionInput::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#descriptionInput:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

/* Character Counter */
.char-counter {
    text-align: right;
    margin-top: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.char-counter.warning {
    color: rgba(255, 200, 100, 0.9);
}

.char-counter.error {
    color: rgba(255, 100, 100, 0.9);
}

/* Upload Button */
#uploadBtn {
    width: 100%;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 32px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-state p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 24px;
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 12px;
    margin-bottom: 24px;
}

.error-message {
    color: rgba(255, 150, 150, 0.95);
    margin-bottom: 16px;
    font-size: 15px;
}

/* Success State */
.success-state {
    text-align: center;
    padding: 24px;
    background: rgba(100, 255, 100, 0.1);
    border: 1px solid rgba(100, 255, 100, 0.3);
    border-radius: 12px;
    margin-bottom: 24px;
}

.success-message {
    color: rgba(150, 255, 150, 0.95);
    font-size: 15px;
}

/* Gallery Section */
.gallery-section {
    margin-top: 48px;
}

.gallery-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

/* Gallery Grid - Responsive */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-item {
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px 0 rgba(0, 0, 0, 0.4);
}

/* Delete Button */
.gallery-item-delete {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(255, 50, 50, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
}

.gallery-item:hover .gallery-item-delete {
    opacity: 1;
}

.gallery-item-delete:hover {
    background: rgba(255, 30, 30, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 50, 50, 0.5);
}

.gallery-item-delete svg {
    color: white;
}

.gallery-item-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    background: rgba(0, 0, 0, 0.3);
}

.gallery-item-info {
    padding: 16px;
}

.gallery-item-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-item-timestamp {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-bottom: 12px;
}

/* Comments Section */
.gallery-item-comments {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.comments-list {
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

.comments-list::-webkit-scrollbar {
    width: 4px;
}

.comments-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.no-comments {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    font-style: italic;
    margin: 0;
}

.comment-item {
    margin-bottom: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.comment-item:last-child {
    margin-bottom: 0;
}

.comment-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    margin: 0 0 4px 0;
    line-height: 1.4;
    word-wrap: break-word;
}

.comment-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
}

.comment-input-container {
    display: flex;
    gap: 6px;
    align-items: center;
}

.comment-input {
    flex: 1;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.comment-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

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

.comment-submit {
    padding: 6px 8px;
    background: rgba(100, 150, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-submit:hover {
    background: rgba(100, 150, 255, 1);
    transform: scale(1.05);
}

.comment-submit svg {
    color: white;
}

/* Gallery Loading/Empty States */
.gallery-loading {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.6);
}

.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
}

/* Image Modal */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    max-width: 1200px;
    max-height: 90vh;
    background: rgba(20, 30, 45, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px 0 rgba(0, 0, 0, 0.7);
    z-index: 2001;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.95);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2002;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

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

#modalImage {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.modal-info {
    padding: 24px;
    background: rgba(0, 0, 0, 0.3);
}

.modal-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.modal-timestamp {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* Responsive Breakpoints */

/* Tablet */
@media (max-width: 768px) {
    .tool-card {
        padding: 32px 24px;
    }

    .tool-header h1 {
        font-size: 36px;
    }

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

    .gallery-item-image {
        height: 180px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .tool-container {
        padding: 80px 16px 32px;
    }

    .tool-card {
        padding: 24px 16px;
    }

    .tool-header h1 {
        font-size: 32px;
    }

    .tool-description {
        font-size: 14px;
    }

    .upload-section {
        padding: 20px 16px;
    }

    .file-input-label {
        width: 100%;
        justify-content: center;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gallery-item-image {
        height: 220px;
    }

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

    .modal-content {
        max-width: 95%;
        max-height: 85vh;
    }

    #modalImage {
        max-height: 60vh;
    }

    .modal-info {
        padding: 16px;
    }
}
