/* 学校行事写真お預かりシステム スタイルシート */

/* 基本スタイル */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

/* ヘッダー */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

header h1 {
    color: #2c3e50;
    font-size: 1.8rem;
}

/* アップロードガイドリンク */
.upload-guide-link {
    text-align: center;
    margin-bottom: 18px;
}

.upload-guide-link a {
    color: #1976d2;
    font-weight: bold;
    font-size: 1.08rem;
    text-decoration: underline;
    letter-spacing: 0.02em;
    background: none !important;
    border: none !important;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    transition: color 0.2s;
}

.upload-guide-link a:hover {
    color: #0d47a1;
    text-decoration: underline wavy;
    background: none !important;
    transform: none;
}

/* フォーム要素 */
.form-group {
    margin-bottom: 30px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

textarea {
    height: 100px;
    resize: vertical;
}

.required {
    color: #e74c3c;
    font-size: 0.85em;
}

.optional {
    color: #7f8c8d;
    font-size: 0.85em;
}

.character-count {
    text-align: right;
    font-size: 0.85em;
    color: #7f8c8d;
    margin-top: 5px;
}

.character-count .over {
    color: #e74c3c;
}

/* ファイルアップロード関連 */
.file-upload-container {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px dashed #ddd;
    display: flex;
    gap: 32px;
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: wrap;
}
.upload-left {
    width: 340px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 16px;
}
.upload-right {
    flex: 1 1 0;
    min-width: 140px;
    max-width: 320px;
}
.file-action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 32px;
    width: 100%;
    justify-content: flex-start;
}
.upload-btn-box {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    padding: 24px 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 0;
}

.upload-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

#file-list-container {
    margin: 20px 0;
}

#file-list-container h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #2c3e50;
}

#file-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 10px;
    background-color: #fff;
    border-radius: 4px;
}

.file-item {
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.file-item:last-child {
    border-bottom: none;
}

#total-size {
    margin-top: 10px;
    text-align: right;
    font-weight: bold;
    color: #2c3e50;
}

/* プログレスバー */
#progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

#progress-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    width: 90%;
    max-width: 500px;
    text-align: center;
}

#progress-overlay:not(.hidden),
#progress-container:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

#progress-container h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #2c3e50;
}

.progress-bar-container {
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background-color: #2ecc71;
    width: 0;
    transition: width 0.3s ease;
}

#progress-text {
    text-align: center;
    font-weight: bold;
    margin-bottom: 5px;
}

#upload-status {
    text-align: center;
    color: #7f8c8d;
}

/* プログレスバーのアニメーション */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.progress-bar.processing {
    animation: pulse 1.5s infinite;
}

/* アップロード状態表示の強調 */
.upload-status {
    margin-top: 10px;
    font-weight: bold;
}

.upload-status.processing {
    color: #2196F3;
}

/* ボタン */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s, transform 0.1s;
    background-color: #3498db;
    color: white;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: #3498db;
    color: white;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    background-color: #2980b9;
    box-shadow: 0 4px 8px rgba(41, 128, 185, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    border-radius: 5px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s;
}

/* 追加: モーダルタイトル・フッター中央揃え */
.modal-title-center {
    width: 100%;
    text-align: center !important;
    justify-content: center !important;
    display: block !important;
}
.modal-footer-center {
    justify-content: center !important;
    text-align: center !important;
    display: flex !important;
}

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

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

.modal-header h2 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 0;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 20px;
    line-height: 1.5;
}

.modal-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

#progress-container:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

/* フッター */
footer {
    margin-top: 40px;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .file-buttons,
    .upload-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }
    
    .form-group {
        margin-bottom: 30px;
    }
    
    input[type="text"],
    input[type="email"],
    select,
    textarea {
        padding: 8px;
        font-size: 14px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}