/* YoseMovie Create Project Desktop Styles */

/**
 * Desktop-specific styles for create project pages
 * Complements the homepage-enhanced.css base styles
 */

/* Main layout adjustments */
.create-main {
    padding-top: 120px; /* Account for fixed header with more space */
    min-height: 100vh;
    background: transparent; /* 背景を透明に */
}

/* Template Select Section */
.template-select-section {
    padding: 60px 0 120px; /* 下のパディングを60px増やして角R分伸ばす */
    background: #f0f1f3;
    border-radius: 60px 60px 0 0;
}

/* Search Container */
.search-container {
    flex-shrink: 0;
    position: relative;
}

.search-box {
    width: 300px;
    padding: 10px 20px 10px 45px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    height: 42px;
    box-sizing: border-box;
    line-height: 1;
}

.search-container::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23636e72" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    pointer-events: none;
    z-index: 1;
}

.search-box:focus {
    outline: none;
    border-color: #ffcc02;
    box-shadow: 0 0 0 4px rgba(255, 204, 2, 0.1);
}

/* Override template grid for desktop - index.htmlと同じスタイルに統一 */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 250px));
    gap: 20px;
    justify-content: center;
    align-items: start; /* カードを上部に配置して重なりを防ぐ */
}

/* Template card styles - index.htmlと同じに統一 */
.template-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    min-height: 0; /* Flexboxの収縮を許可 */
    align-self: start; /* グリッドアイテムの開始位置に配置 */
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-color: #ffcc02;
    background: rgba(255, 255, 255, 1);
}

.template-preview {
    aspect-ratio: 16/9;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.template-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
}

.template-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.template-name {
    font-size: 16px;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 8px;
}

.template-description {
    font-size: 12px;
    color: #636e72;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Button container - index.htmlと同じスタイルに統一 */
.templates-more-container {
    text-align: center;
    margin-top: 32px;
}

.btn-templates-more {
    display: inline-block;
    padding: 16px 32px;
    background: #1d1d1f;
    color: #ffcc02;
    text-decoration: none;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(29, 29, 31, 0.2);
    font-size: 16px;
}

.btn-templates-more:hover {
    background: #2d2d2f;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(29, 29, 31, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .create-main {
        padding-top: 85px; /* ヘッダー60px + 25px下げる */
    }
    
    .template-select-section {
        padding: 32px 0 120px; /* 上部パディングを減らしてコンパクトに */
        border-radius: 40px 40px 0 0;
    }
    
    /* コンテンツのみ上に移動（背景は据え置き） */
    .features-container {
        transform: translateY(-40px);
    }
    
    .filter-controls {
        margin-bottom: 5px; /* 入力フィールドとカードの間を半分以下に */
        margin-top: 60px; /* サブタイトルからの間隔を60pxに */
        justify-content: flex-start; /* 左合わせに変更 */
    }
    
    .cta {
        border-radius: 40px 40px 0 0;
        margin-top: -40px; /* モバイルでは40px上に上げる */
    }
    
    .footer {
        margin-top: 0; /* CTAから連続するので間隔を調整 */
    }
    
    .nav-links {
        display: none !important; /* モバイルではナビゲーションメニューを非表示 */
    }
    
    .header-container .nav-links {
        display: none !important; /* 確実に非表示にする */
    }
    
    /* モバイル版のヘッダー高さ */
    .header {
        height: 60px;
    }
    
    .header-container {
        height: 60px;
        padding: 0 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    /* モバイル版のログインボタン */
    .btn-login {
        border-radius: 20px !important;
        border: none !important;
        background: #1d1d1f !important;
        color: #ffcc02 !important;
        padding: 6px 12px !important;
        font-weight: 600 !important;
        font-size: 11px !important;
        display: inline-block !important;
    }
    
    /* ヘッダーボタン配置 */
    .header-buttons {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .mobile-menu-btn {
        font-size: 18px;
        background: none;
        border: none;
        color: #1d1d1f;
        padding: 4px;
    }
    
    /* モバイルでタイトルを調整 */
    .section-title {
        font-size: 28px !important;
        font-weight: 700 !important;
        margin-bottom: 8px !important;
        text-align: left !important;
    }
    
    /* モバイルでサブタイトルに改行を追加 */
    .section-subtitle {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 20px !important;
        text-align: left !important;
    }
    
    /* デスクトップのタイトル・サブタイトルは中央配置のまま */
    
    /* モバイルで改行を表示 */
    .mobile-break {
        display: inline;
    }
    
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        align-items: start; /* モバイルでもカードを上部に配置 */
    }
    
    .search-container {
        margin-bottom: 0; /* モバイル版でもマージンを削除 */
    }
    
    .filter-controls {
        flex-direction: row;
        justify-content: flex-start; /* 左合わせに統一 */
        gap: 12px;
        flex-wrap: wrap;
        margin-bottom: 5px; /* モバイルでのマージン設定 */
        margin-top: 60px; /* サブタイトルからの間隔 */
    }
    
    /* モバイルではホバー効果を無効化 */
    .sort-dropdown:hover,
    .category-dropdown:hover {
        background: #ffcc02; /* ホバー時も元の色を維持 */
        border-color: #ffcc02;
        color: #1d1d1f;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%231d1d1f" d="M6 8L0 0h12z"/></svg>');
        background-repeat: no-repeat;
        background-position: right 15px center;
    }
    
    /* モバイルでテンプレートカードのホバー効果を無効化 */
    .template-card:hover {
        transform: none; /* 移動効果を無効化 */
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); /* 元のシャドウを維持 */
        border-color: rgba(255, 255, 255, 0.8); /* 元のボーダー色を維持 */
        background: rgba(255, 255, 255, 0.9); /* 元の背景色を維持 */
    }
    
    .sort-dropdown,
    .category-dropdown {
        width: 140px; /* モバイルでも統一 */
        min-width: auto;
    }
    
    .search-box {
        width: 300px; /* モバイルでも300px */
    }
    
    /* 675px幅での具体的な調整 */
    @media (min-width: 675px) and (max-width: 689px) {
        .search-container {
            margin-bottom: 0 !important; /* 強制的にマージンをリセット */
            margin-top: 0 !important;
        }
        
        .filter-controls {
            align-items: center !important; /* 強制的に中央揃え */
        }
        
        .search-box {
            height: 42px !important;
            margin: 0 !important;
            padding: 10px 20px 10px 45px !important; /* パディングを調整 */
            vertical-align: middle !important;
        }
        
        .sort-dropdown,
        .category-dropdown {
            height: 42px !important;
            vertical-align: middle !important;
        }
    }
    
    /* 690px以上での調整 */
    @media (min-width: 690px) and (max-width: 768px) {
        .filter-controls {
            align-items: center;
        }
        
        .sort-dropdown,
        .category-dropdown,
        .search-box {
            height: 42px;
            box-sizing: border-box;
        }
        
        .search-container {
            display: flex;
            align-items: center;
            margin-bottom: 0;
        }
    }
    
    .btn-templates-more {
        padding: 14px 36px;
        font-size: 16px;
    }
}

/* Small Mobile breakpoint for grid - index.htmlと同じ */
@media (max-width: 480px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        align-items: start; /* 小型モバイルでもカードを上部に配置 */
    }
    
    /* 小型モバイルでは角Rをさらに小さく - index.htmlと同じ */
    .template-select-section {
        border-radius: 30px 30px 0 0 !important;
        padding: 24px 0 110px; /* 上部もさらにコンパクトに */
    }
    
    .filter-controls {
        margin-bottom: 4px; /* 小型モバイルでは入力フィールドとカードの間を半分以下に */
        margin-top: 60px; /* 小型モバイルでも60pxのマージン */
        justify-content: flex-start; /* 小型モバイルでも左合わせ */
    }
    
    /* 小型モバイルでもホバー効果を無効化 */
    .sort-dropdown:hover,
    .category-dropdown:hover {
        background: #ffcc02; /* ホバー時も元の色を維持 */
        border-color: #ffcc02;
        color: #1d1d1f;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%231d1d1f" d="M6 8L0 0h12z"/></svg>');
        background-repeat: no-repeat;
        background-position: right 15px center;
    }
    
    /* 小型モバイルでもテンプレートカードのホバー効果を無効化 */
    .template-card:hover {
        transform: none; /* 移動効果を無効化 */
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); /* 元のシャドウを維持 */
        border-color: rgba(255, 255, 255, 0.8); /* 元のボーダー色を維持 */
        background: rgba(255, 255, 255, 0.9); /* 元の背景色を維持 */
    }
    
    /* 小型モバイルでタイトル・サブタイトルを更に調整 */
    .section-title {
        font-size: 26px !important;
        margin-bottom: 6px !important;
    }
    
    .section-subtitle {
        margin-bottom: 16px !important;
    }
    
    .cta {
        border-radius: 30px 30px 0 0 !important;
        margin-top: -30px; /* 30px分に調整 */
    }
    
    .footer {
        margin-top: 0 !important; /* CTAから連続するので間隔を調整 */
    }
}

/* Hide mobile-specific elements */
.header-back,
.header-help {
    display: none;
}

/* Filter Controls Layout */
.filter-controls {
    display: flex;
    align-items: center;
    justify-content: center; /* デスクトップは中央配置 */
    gap: 20px;
    margin-bottom: 24px; /* デスクトップは元のマージン */
    flex-wrap: wrap;
}

/* 674px以下では左合わせ */
@media (max-width: 674px) {
    .filter-controls {
        justify-content: flex-start !important;
    }
    
    .section-title,
    .section-subtitle {
        text-align: left !important;
    }
}

/* Sort Dropdown */
.sort-dropdown-container {
    flex-shrink: 0;
}

.sort-dropdown {
    padding: 10px 20px;
    border: 2px solid #ffcc02;
    border-radius: 25px;
    background: #ffcc02;
    color: #1d1d1f;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    width: 140px; /* 幅を短く */
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%231d1d1f" d="M6 8L0 0h12z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    box-sizing: border-box;
    height: 42px; /* index.htmlのタブと同じ高さ */
    line-height: 1;
}

.sort-dropdown:hover {
    background: #e6b800;
    border-color: #ffcc02;
    color: #1d1d1f;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%231d1d1f" d="M6 8L0 0h12z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.sort-dropdown:focus {
    border-color: #ffcc02;
    box-shadow: 0 0 0 4px rgba(255, 204, 2, 0.1);
}

/* Category Dropdown */
.category-dropdown-container {
    flex-shrink: 0;
}

.category-dropdown {
    padding: 10px 20px;
    border: 2px solid #ffcc02;
    border-radius: 25px;
    background: #ffcc02;
    color: #1d1d1f;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    width: 140px; /* 幅を統一 */
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%231d1d1f" d="M6 8L0 0h12z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    box-sizing: border-box;
    height: 42px; /* index.htmlのタブと同じ高さ */
    line-height: 1;
}

.category-dropdown:hover {
    background: #e6b800;
    border-color: #ffcc02;
    color: #1d1d1f;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path fill="%231d1d1f" d="M6 8L0 0h12z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.category-dropdown:focus {
    border-color: #ffcc02;
    box-shadow: 0 0 0 4px rgba(255, 204, 2, 0.1);
}

/* モバイル専用改行を非表示 */
.mobile-break {
    display: none;
}

/* Ensure proper spacing for fixed elements */
body {
    padding-top: 0;
    background: #ffffff; /* index.htmlと同じ白背景 */
}

/* Header navigation styling */
.nav-links {
    display: flex;
    gap: 32px;
    justify-content: center;
    flex: 1;
}

.nav-link {
    color: #1d1d1f !important;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #2d3436 !important;
}

/* Desktop login button styling */
.btn-login {
    background: #1d1d1f;
    color: #ffcc02;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
}

.btn-login:hover {
    background: #2d2d2f;
}

/* CTA and Footer styling to match index.html */
.cta {
    border-radius: 60px 60px 0 0;
    margin-top: -60px; /* セクション背景と重なるように上に上げる */
}

.footer {
    margin-top: 0; /* CTAから連続するので間隔を調整 */
}

/* Override mobile-specific styles */
.phone-container {
    width: 100%;
    max-width: none;
    min-height: auto;
    background: transparent;
    box-shadow: none;
    margin: 0;
}

.main-content {
    padding: 0;
    background: transparent;
    border-radius: 0;
    min-height: auto;
}