/* Share Page Custom Styles - 适配 Clubhouse 主题 */

/* Reset for form elements to ensure consistency across browsers */
select, button {
    margin: 0;
    vertical-align: baseline;
}

.container {
    display: grid;
    grid-gap: 20px;
    margin: 20px auto;
    padding: 0 20px;
    
    /* Responsive grid layout */
    /* Small screens: 2 columns */
    grid-template-columns: repeat(2, 1fr);
    max-width: 600px;
}

/* Medium screens: 3 columns */
@media (min-width: 768px) {
    .container {
        grid-template-columns: repeat(3, 1fr);
        max-width: 900px;
    }
}

/* Large screens: 4 columns */
@media (min-width: 1024px) {
    .container {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1200px;
    }
}

/* Extra large screens: 6 columns */
@media (min-width: 1440px) {
    .container {
        grid-template-columns: repeat(6, 1fr);
        max-width: 1800px;
    }
}

.image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slot {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(6, 182, 212, 0.3);
    box-sizing: border-box;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.slot:hover {
    border-color: rgba(6, 182, 212, 0.5);
    background-color: rgba(255, 255, 255, 0.08);
}

.slot .file-input {
    display: none;
}

.slot .thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.slot .thumbnail:hover {
    transform: scale(1.02);
}

.controls {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.duration-select {
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    box-sizing: border-box;
    flex: 1;
    min-width: 80px;
    transition: all 0.3s ease;

    /* Chrome specific fixes */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;

    /* Ensure consistent font family */
    font-family: inherit;
}

.duration-select:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(6, 182, 212, 0.5);
}

.duration-select option {
    background-color: #1a1a2e;
    color: #fff;
}

.upload-button {
    padding: 6px 16px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid rgba(4, 255, 9, 0.5);
    border-radius: 4px;
    background: linear-gradient(135deg, rgba(94, 5, 154, 0.2), rgba(106, 2, 95, 0.2));
    color: #fff;
    box-sizing: border-box;
    flex: 1;
    min-width: 80px;
    transition: all 0.3s ease;

    /* Ensure consistent appearance */
    font-family: inherit;
    line-height: 1.2;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.upload-button:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(8, 145, 178, 0.3));
    border-color: rgba(6, 182, 212, 0.7);
    transform: translateY(-1px);
}

/* Larger controls for bigger screens */
@media (min-width: 1024px) {
    .duration-select {
        font-size: 15px;
        padding: 10px 15px;
        padding-right: 35px;
    }
    
    .upload-button {
        font-size: 15px;
        padding: 8px 15px;
        min-height: 42px;
    }
}

@media (min-width: 1440px) {
    .controls {
        gap: 10px;
    }
    
    .duration-select {
        font-size: 16px;
        padding: 10px 20px;
        padding-right: 40px;
    }
    
    .upload-button {
        font-size: 16px;
        padding: 10px 20px;
        min-height: 46px;
    }
}

.slot-description {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(94, 5, 154, 0.4), rgba(106, 2, 95, 0.4));
    /*background-color: rgba(13, 13, 63, 0.755);*/
    border-radius: 6px;
    border: 1px solid rgba(17, 255, 0, 0.69);
    color: rgba(255, 255, 255, 1);
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-height: 80px;
    overflow-y: auto;
    text-align: left;
}

.slot-description::-webkit-scrollbar {
    width: 4px;
}

.slot-description::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.slot-description::-webkit-scrollbar-thumb {
    background: rgba(6, 182, 212, 0.3);
    border-radius: 2px;
}

.slot-description::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 182, 212, 0.5);
}

.countdown {
    margin-top: 5px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.fullscreen-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 999;
}

.fullscreen-viewer img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    max-width: 90vw;
    max-height: 90vh;
}

.fullscreen-viewer video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    max-width: 90vw;
    max-height: 90vh;
}

.slot video.thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Upload Widget Styles */
.upload-widget-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.upload-widget-overlay.active {
    display: flex;
}

.upload-widget {
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.95), rgba(45, 55, 72, 0.95));
    border-radius: 12px;
    border: 1px solid rgba(6, 182, 212, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

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

.upload-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
}

.upload-widget-header h3 {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
}

.upload-widget-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.upload-widget-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.upload-widget-body {
    padding: 20px;
}

.upload-widget-section {
    margin-bottom: 20px;
}

.upload-widget-section:last-child {
    margin-bottom: 0;
}

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

.upload-file-drop-zone {
    position: relative;
    border: 2px dashed rgba(6, 182, 212, 0.3);
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-file-drop-zone:hover {
    border-color: rgba(6, 182, 212, 0.5);
    background-color: rgba(255, 255, 255, 0.05);
}

.upload-file-drop-zone.dragging {
    border-color: rgba(6, 182, 212, 0.7);
    background-color: rgba(6, 182, 212, 0.1);
}

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

.upload-file-placeholder {
    pointer-events: none;
}

.upload-file-placeholder svg {
    color: rgba(6, 182, 212, 0.7);
    margin-bottom: 10px;
}

.upload-file-placeholder p {
    margin: 5px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.upload-file-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px !important;
}

.upload-file-preview {
    position: relative;
    max-width: 100%;
}

.upload-file-preview img,
.upload-file-preview video {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    object-fit: contain;
}

.upload-file-remove {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: 2px solid #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.upload-file-remove:hover {
    background-color: rgb(239, 68, 68);
    transform: scale(1.1);
}

.upload-description-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
}

.upload-description-input:focus {
    outline: none;
    border-color: rgba(6, 182, 212, 0.6);
    background-color: rgba(255, 255, 255, 0.08);
}

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

.upload-description-counter {
    text-align: right;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
}

.upload-duration-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.upload-duration-select:focus {
    outline: none;
    border-color: rgba(6, 182, 212, 0.6);
    background-color: rgba(255, 255, 255, 0.08);
}

.upload-duration-select option {
    background-color: #1a1a2e;
    color: #fff;
}

.upload-widget-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.upload-widget-cancel,
.upload-widget-submit {
    flex: 1;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: inherit;
}

.upload-widget-cancel {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.upload-widget-cancel:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.upload-widget-submit {
    background: linear-gradient(135deg, rgb(6, 182, 212), rgb(8, 145, 178));
    color: #fff;
}

.upload-widget-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, rgb(8, 195, 227), rgb(10, 158, 195));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.upload-widget-submit:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

/* 隐藏旧的 file input */
.file-input-hidden {
    display: none !important;
}

/* Upload Progress Indicator */
.upload-progress-container {
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.upload-progress-bar {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgb(6, 182, 212), rgb(8, 145, 178));
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

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

.upload-progress-text {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
}

.upload-progress-text .upload-progress-percentage {
    color: rgb(6, 182, 212);
    font-weight: 600;
}
