/**
 * 写真管理機能のスタイル
 * 
 * @package Potobook
 * @since 1.0.0
 */

/* 写真ギャラリー */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.photo-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.photo-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover .photo-thumbnail img {
    transform: scale(1.05);
}

.photo-info {
    padding: 15px;
}

.photo-info h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.photo-info p {
    margin: 4px 0;
    font-size: 14px;
    color: #666;
}

/* 写真アップロードフォーム */
.photo-upload-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.photo-upload-form h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    padding: 12px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.file-upload-label:hover {
    border-color: #007cba;
}

.file-preview {
    margin-top: 10px;
    text-align: center;
}

.file-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background: #005a87;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
}

/* 写真モーダル */
.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background: #fff;
    margin: 20px auto;
    max-width: 900px;
    border-radius: 8px;
    overflow: hidden;
}

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

.modal-header h2 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #333;
}

.photo-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.photo-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.photo-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.btn-replace,
.btn-download {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-replace {
    background: #28a745;
    color: #fff;
}

.btn-replace:hover {
    background: #218838;
}

.btn-download {
    background: #17a2b8;
    color: #fff;
}

.btn-download:hover {
    background: #138496;
}

/* コメントセクション */
.photo-comments {
    padding: 30px;
    border-top: 1px solid #eee;
}

.photo-comments h3 {
    margin: 0 0 20px 0;
    color: #333;
}

.comment-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.comment-user {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.comment-text {
    color: #555;
    margin-bottom: 8px;
    line-height: 1.5;
}

.comment-date {
    font-size: 12px;
    color: #888;
}

#photo-comment-form {
    margin-top: 20px;
}

#photo-comment-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    resize: vertical;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: #f8f9fa;
    border-color: #007cba;
}

.pagination .current {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

/* アラートメッセージ */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: #fff;
    font-weight: 600;
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

.alert-success {
    background: #28a745;
}

.alert-error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ローディングオーバーレイ */
#loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    justify-content: center;
    align-items: center;
}

.loading {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: #333;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
        padding: 15px 0;
    }
    
    .photo-detail {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .photo-upload-form {
        padding: 20px;
    }
    
    .modal-content {
        margin: 10px;
        max-width: none;
    }
    
    .photo-actions {
        flex-direction: column;
    }
    
    .btn-replace,
    .btn-download {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .photo-gallery {
        grid-template-columns: 1fr;
    }
    
    .photo-thumbnail {
        height: 180px;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}

/* ユーザー役割別スタイル */
.role-cosplayer .photographer-only {
    display: none;
}

.role-photographer .cosplayer-only {
    display: none;
}

/* 写真差し替えフォーム */
.photo-replace-form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.photo-replace-form h3 {
    margin: 0 0 15px 0;
    color: #333;
}

/* コスプレイヤー選択 */
.cosplayer-select-container {
    margin-bottom: 20px;
}

.cosplayer-select-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

#cosplayer-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 写真がない場合のメッセージ */
.no-photos {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 18px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

/* アクセス制限メッセージ */
.access-denied {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
    font-size: 16px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
} 