/* Urban Legends Submission Plugin - Frontend Styles */

/* ================================
   Submission Form Styles
   ================================ */

#uls-submission-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
}

.uls-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #444;
}

.uls-form-header h2 {
    color: #ff6b35;
    font-size: 28px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.uls-form-header p {
    color: #b0b0b0;
    font-size: 16px;
    line-height: 1.6;
}

.uls-form-group {
    margin-bottom: 25px;
}

.uls-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #f0f0f0;
    font-size: 16px;
}

.required {
    color: #ff4757;
    font-weight: normal;
}

.uls-form input[type="text"],
.uls-form input[type="email"],
.uls-form textarea,
.uls-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #444;
    border-radius: 8px;
    background: #333;
    color: #e0e0e0;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.uls-form input[type="text"]:focus,
.uls-form input[type="email"]:focus,
.uls-form textarea:focus,
.uls-form select:focus {
    outline: none;
    border-color: #ff6b35;
    background: #3a3a3a;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

.uls-form textarea {
    resize: vertical;
    min-height: 150px;
    font-family: inherit;
    line-height: 1.6;
}

.uls-char-counter {
    text-align: right;
    font-size: 14px;
    color: #888;
    margin-top: 5px;
}

.uls-char-counter.warning {
    color: #ff6b35;
    font-weight: bold;
}

.uls-form input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #555;
    border-radius: 8px;
    background: #2a2a2a;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.uls-form input[type="file"]:hover {
    border-color: #ff6b35;
    background: #333;
}

.uls-file-info {
    font-size: 13px;
    color: #888;
    margin-top: 5px;
    font-style: italic;
}

.uls-help-text {
    font-size: 14px;
    color: #999;
    margin-top: 5px;
    font-style: italic;
}

.uls-terms {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #ff6b35;
}

.uls-terms input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    transform: scale(1.2);
}

.uls-terms-text {
    margin-top: 10px;
    font-size: 14px;
    color: #b0b0b0;
}

.uls-terms-text ul {
    margin: 10px 0;
    padding-left: 20px;
}

.uls-terms-text li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.uls-form-actions {
    text-align: center;
    margin-top: 30px;
}

.uls-submit-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
    position: relative;
    overflow: hidden;
}

.uls-submit-btn:hover {
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4);
}

.uls-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.uls-btn-loading {
    display: inline-block;
}

/* ================================
   Notice Messages
   ================================ */

.uls-notice {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 16px;
    line-height: 1.5;
}

.uls-notice-success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid #22c55e;
    color: #86efac;
}

.uls-notice-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

.uls-notice-warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid #f59e0b;
    color: #fcd34d;
}

/* ================================
   Post List Styles
   ================================ */

.uls-post-list {
    margin: 20px 0;
}

.uls-section-title {
    color: #ff6b35;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.uls-section-title:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #ff8c42);
    margin: 10px auto;
    border-radius: 2px;
}

.uls-posts-container {
    display: grid;
    gap: 20px;
}

.uls-style-list .uls-posts-container {
    grid-template-columns: 1fr;
}

.uls-style-grid .uls-posts-container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.uls-post-item {
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.uls-post-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.2);
    border-color: #ff6b35;
}

.uls-post-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #ff6b35, #ff8c42);
}

.uls-post-thumbnail {
    position: relative;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    height: 200px;
}

.uls-post-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

.uls-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.uls-post-thumbnail:hover img {
    transform: scale(1.05);
}

/* Video thumbnail specific styles */
.uls-video-thumbnail-wrapper {
    position: relative;
}

.uls-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.uls-video-play-icon::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 20px solid #fff;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 4px;
}

.uls-post-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.4;
}

.uls-post-title a {
    color: #f0f0f0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.uls-post-title a:hover {
    color: #ff6b35;
}

.uls-post-excerpt {
    color: #b0b0b0;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 14px;
}

.uls-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    font-size: 14px;
    color: #888;
    border-top: 1px solid #333;
    padding-top: 15px;
}

.uls-post-date,
.uls-post-views {
    display: flex;
    align-items: center;
    gap: 5px;
}

.uls-rank-badge {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 12px;
}

.uls-post-categories {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.uls-category-tag {
    background: rgba(255, 107, 53, 0.2);
    color: #ff6b35;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.uls-view-count {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 8px;
    border-left: 4px solid #ff6b35;
    color: #e0e0e0;
    font-size: 14px;
}

.uls-load-more {
    text-align: center;
    margin-top: 30px;
}

.uls-load-more-btn {
    background: linear-gradient(135deg, #333 0%, #444 100%);
    color: #e0e0e0;
    border: 2px solid #ff6b35;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.uls-load-more-btn:hover {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

/* ================================
   Carousel Styles (ULS Plugin Specific)
   ================================ */

.uls-post-list.uls-style-carousel {
    position: relative;
    max-width: 100vw !important;
    margin: 60px auto;
    overflow: visible;
}

.uls-carousel-header {
    text-align: center;
    margin-bottom: 20px;
    z-index: 10;
    position: relative;
}

.uls-carousel-header .uls-section-title {
    color: #fff;
    font-size: 1.5em;
    margin: 0;
}

.uls-carousel-wrapper {
    position: relative;
    overflow: visible;
    background: transparent;
    border: none;
}

.uls-post-list.uls-style-carousel .uls-posts-container {
    position: relative;
    height: 500px;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uls-post-list.uls-style-carousel .uls-post-item {
    position: absolute;
    top: 0;
    left: 50%;
    width: 400px;
    height: 100%;
    margin-left: -200px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(0) scale(0);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    box-sizing: border-box;
    background: rgba(34, 34, 34, 0.95);
    border: 1px solid #444;
    border-radius: 0.5rem;
}

.uls-post-list.uls-style-carousel .uls-post-item.uls-is-active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
    z-index: 3;
    border-color: #ff783c;
}

.uls-post-list.uls-style-carousel .uls-post-item.uls-is-prev {
    opacity: 0.6;
    visibility: visible;
    transform: translateX(-80%) scale(0.65);
    z-index: 1;
}

.uls-post-list.uls-style-carousel .uls-post-item.uls-is-next {
    opacity: 0.6;
    visibility: visible;
    transform: translateX(80%) scale(0.65);
    z-index: 1;
}

.uls-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 120, 60, 0.9);
    border: none;
    color: white;
    font-size: 28px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.uls-carousel-nav:hover {
    background: rgba(255, 120, 60, 1);
    transform: translateY(-50%) scale(1.1);
}

.uls-carousel-prev {
    left: calc(50% - 225px);
}

.uls-carousel-next {
    right: calc(50% - 225px);
}

.uls-carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.uls-indicator {
    width: 18px;
    height: 6px;
    border: none;
    background: #444;
    cursor: pointer;
    transition: background-color 0.3s ease;
    padding: 0;
}

.uls-indicator.active {
    background: #ff783c;
}

.uls-indicator:hover {
    background: #ff783c;
}

/* ================================
   Responsive Design
   ================================ */

@media (max-width: 768px) {
    #uls-submission-form-wrapper {
        padding: 15px;
        margin: 10px;
    }

    .uls-form-header h2 {
        font-size: 22px;
    }

    .uls-style-grid .uls-posts-container {
        grid-template-columns: 1fr;
    }

    .uls-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .uls-post-list.uls-style-carousel .uls-post-item {
        width: 90%;
        padding: 20px;
    }

    .uls-post-list.uls-style-carousel .uls-post-item.uls-is-prev {
        transform: translateX(-80%) scale(0.8);
    }

    .uls-post-list.uls-style-carousel .uls-post-item.uls-is-next {
        transform: translateX(80%) scale(0.8);
    }

    .uls-carousel-navigation {
        bottom: 10px;
    }

    .uls-carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .uls-form input[type="text"],
    .uls-form input[type="email"],
    .uls-form textarea,
    .uls-form select {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .uls-submit-btn {
        width: 100%;
        padding: 15px;
    }
}

/* ================================
   Hide Article Thumbnail for ULS Posts
   ================================ */

/* 都市伝説投稿のアイキャッチ画像を非表示 */
.single-uls_submission .p-articleThumb {
    display: none !important;
}

.single-uls_submission .post_content {
    margin-top: 24px;
}

/* ================================
   Dark Theme Enhancements
   ================================ */

.uls-no-posts {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 40px 20px;
    background: rgba(255, 107, 53, 0.05);
    border: 1px dashed #333;
    border-radius: 8px;
}

/* Loading states */
.uls-loading {
    opacity: 0.6;
    pointer-events: none;
}

.uls-loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #333;
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    animation: uls-spin 1s linear infinite;
}

@keyframes uls-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================================
   Section Headers for Post Lists
   ================================ */

/* Main post list container - add margin for spacing between sections */
.uls-post-list {
    margin-top: 50px;
    margin-bottom: 50px;
}

.uls-post-list .uls-section-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #333;
}

.uls-post-list .uls-section-header .uls-section-title,
.uls-post-list.uls-style-carousel .uls-carousel-header .uls-section-title {
    color: #ff6b35;
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Remove any inherited ::before pseudo-elements */
.uls-post-list .uls-section-header .uls-section-title::before,
.uls-post-list.uls-style-carousel .uls-carousel-header .uls-section-title::before {
    display: none;
    content: none;
}

.uls-post-list .uls-section-header .uls-section-subtitle,
.uls-post-list.uls-style-carousel .uls-carousel-header .uls-section-subtitle {
    color: #b0b0b0;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* Carousel specific header styles */
.uls-post-list.uls-style-carousel .uls-carousel-header {
    text-align: center;
    margin-bottom: 20px;
}

.uls-post-list.uls-style-carousel .uls-carousel-header .uls-section-title {
    font-size: 24px;
    margin-bottom: 8px;
}

.uls-post-list.uls-style-carousel .uls-carousel-header .uls-section-subtitle {
    font-size: 13px;
    color: #999;
}

/* Grid style specific adjustments */
.uls-post-list.uls-style-grid .uls-section-header {
    grid-column: 1 / -1;
}

/* Additional spacing for consecutive post lists */
.uls-post-list + .uls-post-list {
    margin-top: 60px;
}

/* ================================
   CTA Button Styles
   ================================ */

.uls-cta-wrapper {
    margin: 30px 0;
    text-align: center;
    animation: uls-fade-in 0.5s ease-in-out;
}

/* Use the same styles as submit button */
.uls-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    color: white !important;
    text-decoration: none !important;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
    position: relative;
    overflow: hidden;
}

.uls-cta-button:hover {
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4);
    color: white !important;
}

.uls-cta-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}

.uls-cta-icon {
    font-size: 20px;
    animation: uls-bounce 2s infinite;
}

.uls-cta-text {
    letter-spacing: 0.5px;
}

/* Carousel specific CTA styles */
.uls-style-carousel .uls-cta-wrapper {
    margin: 20px 0;
}

/* Grid specific CTA styles */
.uls-style-grid .uls-cta-wrapper {
    grid-column: 1 / -1;
    margin: 20px 0;
}

/* Animations for CTA */
@keyframes uls-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes uls-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

/* Responsive CTA */
@media (max-width: 768px) {
    .uls-cta-button {
        font-size: 16px;
        padding: 12px 24px;
    }

    .uls-cta-icon {
        font-size: 18px;
    }
}