/**
 * Stolen Car Register - Styles
 */

/* フォームスタイル */
.scr-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.scr-form-title {
    color: #333;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.scr-form-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.5;
}

.scr-form-sections {
    display: grid;
    gap: 30px;
}

/* フィールドグループのスタイル */
.acf-field-group {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.acf-field-group .acf-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid #0073aa;
}

.scr-form-wrapper .acf-form {
    margin: 0;
}

.scr-form-wrapper .acf-field {
    margin-bottom: 20px;
}

.scr-form-wrapper .acf-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.scr-form-wrapper .acf-input input,
.scr-form-wrapper .acf-input select,
.scr-form-wrapper .acf-input textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.scr-form-wrapper .acf-input input:focus,
.scr-form-wrapper .acf-input select:focus,
.scr-form-wrapper .acf-input textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.scr-form-wrapper .acf-field.acf-error .acf-input input,
.scr-form-wrapper .acf-field.acf-error .acf-input select,
.scr-form-wrapper .acf-field.acf-error .acf-input textarea {
    border-color: #dc3232;
    box-shadow: 0 0 0 1px #dc3232;
}

.scr-form-wrapper .acf-field.acf-error .acf-label {
    color: #dc3232;
}

.scr-submit-button {
    background: #0073aa;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.scr-submit-button:hover {
    background: #005a87;
}

.scr-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 特殊フィールドのスタイル */
.scr-acf-fields img {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.scr-acf-fields img:hover {
    transform: scale(1.05);
}

.scr-acf-fields a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.scr-acf-fields a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* 必須フィールドの表示 */
.acf-field[data-required="1"] .acf-label::after {
    content: " *";
    color: #dc3232;
    font-weight: bold;
}

/* フィールドの重要度に応じたスタイル */
.acf-field[data-name="car_model"],
.acf-field[data-name="car_number"],
.acf-field[data-name="stolen_place"],
.acf-field[data-name="owner_email"] {
    background: #fff8dc;
    border-left: 4px solid #ffd700;
    padding-left: 15px;
}

.acf-field[data-name="reward_amount"] {
    background: #fff0f0;
    border-left: 4px solid #ff6b6b;
    padding-left: 15px;
}

/* マイページスタイル */
.scr-my-posts {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.scr-my-posts h3 {
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.scr-post-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.scr-post-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.scr-post-item h4 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.scr-post-date {
    color: #666;
    font-size: 14px;
    margin: 0 0 15px 0;
}

.scr-acf-fields {
    margin: 15px 0;
}

.scr-acf-fields p {
    margin: 8px 0;
    color: #555;
    font-size: 14px;
}

.scr-acf-fields strong {
    color: #333;
    font-weight: 600;
}

.scr-post-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.scr-edit-link,
.scr-delete-link {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.scr-edit-link {
    background: #0073aa;
    color: #fff;
}

.scr-edit-link:hover {
    background: #005a87;
    color: #fff;
}

.scr-delete-link {
    background: #dc3232;
    color: #fff;
}

.scr-delete-link:hover {
    background: #a00;
    color: #fff;
}

/* メッセージスタイル */
.scr-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: #fff;
    font-weight: 500;
    z-index: 9999;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: scr-slide-in 0.3s ease;
}

.scr-message.scr-success {
    background: #46b450;
}

.scr-message.scr-error {
    background: #dc3232;
}

@keyframes scr-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 成功メッセージスタイル */
.scr-success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 20px 0;
}

/* エラーメッセージスタイル */
.scr-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
}

/* デバッグ情報スタイル */
.scr-debug-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.scr-debug-info h3 {
    color: #495057;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.scr-debug-info p {
    margin: 8px 0;
    color: #6c757d;
}

.scr-debug-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.scr-debug-info li {
    margin: 5px 0;
    color: #6c757d;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .scr-form-wrapper {
        padding: 15px;
        margin: 10px;
    }
    
    .scr-my-posts {
        padding: 15px;
        margin: 10px;
    }
    
    .scr-post-item {
        padding: 15px;
    }
    
    .scr-post-actions {
        flex-direction: column;
    }
    
    .scr-edit-link,
    .scr-delete-link {
        text-align: center;
        margin-bottom: 5px;
    }
    
    .scr-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .scr-post-item.scr-mobile .scr-post-actions {
        flex-direction: column;
    }
}

/* アクセシビリティ対応 */
.scr-message:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.scr-submit-button:focus,
.scr-edit-link:focus,
.scr-delete-link:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .scr-form-wrapper {
        border: 2px solid #000;
    }
    
    .scr-post-item {
        border: 2px solid #000;
    }
    
    .scr-submit-button,
    .scr-edit-link,
    .scr-delete-link {
        border: 2px solid #000;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .scr-form-wrapper {
        background: #2c2c2c;
        border-color: #444;
        color: #fff;
    }
    
    .scr-form-wrapper .acf-label {
        color: #fff;
    }
    
    .scr-form-wrapper .acf-input input,
    .scr-form-wrapper .acf-input select,
    .scr-form-wrapper .acf-input textarea {
        background: #3c3c3c;
        border-color: #555;
        color: #fff;
    }
    
    .scr-post-item {
        background: #2c2c2c;
        border-color: #444;
        color: #fff;
    }
    
    .scr-post-item h4 {
        color: #fff;
    }
    
    .scr-acf-fields p {
        color: #ccc;
    }
    
    .scr-acf-fields strong {
        color: #fff;
    }
}

/* ローディング状態 */
.scr-loading {
    opacity: 0.6;
    pointer-events: none;
}

.scr-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: scr-spin 1s linear infinite;
}

@keyframes scr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 印刷対応 */
@media print {
    .scr-post-actions,
    .scr-submit-button,
    .scr-message {
        display: none !important;
    }
    
    .scr-form-wrapper,
    .scr-post-item {
        border: 1px solid #000;
        box-shadow: none;
    }
} 

/* モーダルウィンドウ */
.scr-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scr-modal.scr-modal-active {
    display: block;
    opacity: 1;
}

.scr-modal-content {
    position: relative;
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.scr-modal.scr-modal-active .scr-modal-content {
    transform: scale(1);
}

.scr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.scr-modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.scr-modal-close {
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

.scr-modal-body {
    padding: 25px;
}

.scr-form-container {
    min-height: 200px;
}

.scr-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* モーダルボタン */
.scr-modal-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-decoration: none;
}

.scr-modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

.scr-modal-button:active {
    transform: translateY(0);
}

.scr-button-icon {
    font-size: 18px;
}

/* モーダル内のフォームスタイル */
.scr-modal .scr-form-wrapper {
    margin: 0;
}

.scr-modal .scr-form-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
}

.scr-modal .scr-form-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

.scr-modal .acf-fields {
    margin: 0;
}

.scr-modal .acf-field {
    margin-bottom: 20px;
}

.scr-modal .acf-label {
    margin-bottom: 8px;
}

.scr-modal .acf-label label {
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

.scr-modal .acf-input input,
.scr-modal .acf-input textarea,
.scr-modal .acf-input select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.scr-modal .acf-input input:focus,
.scr-modal .acf-input textarea:focus,
.scr-modal .acf-input select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.scr-modal .scr-submit-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
}

.scr-modal .scr-submit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.scr-modal .scr-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* メッセージ表示 */
.scr-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 1000000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.scr-message.scr-message-show {
    transform: translateX(0);
}

.scr-message-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.scr-message-error {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

/* モーダルオープン時のbody制御 */
body.scr-modal-open {
    overflow: hidden;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .scr-modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }
    
    .scr-modal-header {
        padding: 15px 20px;
    }
    
    .scr-modal-title {
        font-size: 1.3rem;
    }
    
    .scr-modal-body {
        padding: 20px;
    }
    
    .scr-modal-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .scr-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .scr-modal-content {
        width: 98%;
        margin: 5% auto;
        max-height: 90vh;
    }
    
    .scr-modal-header {
        padding: 12px 15px;
    }
    
    .scr-modal-body {
        padding: 15px;
    }
    
    .scr-modal .scr-form-title {
        font-size: 1.1rem;
    }
} 