/* 格闘ゲーム プロフィールカードメーカー - メインスタイルシート */

/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    color: #212529;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* App Container */
.app-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Header */
.app-header {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1rem 0;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 1rem;
}

.app-header h1 {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.app-header p {
    font-size: 1.125rem;
    color: #6c757d;
}

/* Input Section */
.input-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.input-section h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f39c12;
}

/* Form Styles */
.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
}

.required {
    color: #dc3545;
}

/* Input Elements */
input[type='text'],
input[type='email'],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    font-family: inherit;
}

input[type='text']:focus,
input[type='email']:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

input[type='file'] {
    width: 100%;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    font-size: 0.875rem;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.char-count {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    text-align: right;
    margin-top: 0.25rem;
}

/* Sub Images Container */
.sub-images-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Image Input Container */
.image-input-container {
    position: relative;
    margin-bottom: 0.5rem;
}

.image-input-container input[type="file"] {
    display: none;
}

.image-input-controls {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.btn-file-select {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    min-width: 90px;
}

.btn-file-select:hover {
    background: #0056b3;
}

.btn-file-select:active {
    background: #004085;
}

.paste-area {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.paste-area:hover,
.paste-area:focus {
    border-color: #2980b9;
    background: #e3f2fd;
}

.paste-area.drag-over {
    border-color: #27ae60;
    background: #e8f5e8;
}

.paste-area.has-image {
    border-color: #27ae60;
    background: #d4edda;
}

.paste-text {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
}

.paste-area.has-image .paste-text {
    color: #155724;
}

.sub-image-input label {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

/* Hardware Options */
.hardware-options {
    border: none;
    padding: 0;
}

.hardware-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    font-weight: normal;
    font-size: 0.875rem;
}

.checkbox-label:hover {
    background-color: #f8f9fa;
}

.checkbox-label input[type='checkbox'] {
    margin-right: 0.5rem;
    width: auto;
}

.checkbox-label input[type='checkbox']:checked + span {
    font-weight: 600;
    color: #007bff;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger {
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    font-family: inherit;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #007bff;
    color: #ffffff;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled:hover {
    background: #6c757d;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

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

.btn-success {
    background: #28a745;
    color: #ffffff;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-danger {
    background: #dc3545;
    color: #ffffff;
}

.btn-danger:hover {
    background: #c82333;
}

.form-actions {
    margin-top: 1.5rem;
    text-align: center;
}

/* Preview Section */
.preview-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

.preview-section h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

/* Profile Card */
.profile-card {
    width: 350px;
    min-height: 550px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(243, 156, 18, 0.1) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 15px;
}

/* Card Header */
.card-header {
    text-align: center;
    margin-bottom: 0.75rem;
    z-index: 2;
    position: relative;
}

.card-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    color: #f39c12;
    /* フォントサイズ自動調整で省略表示を無効化 */
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    line-height: 1.2;
    word-wrap: break-word;
}

.card-player-name {
    font-size: 1.125rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Character Section */
.character-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.75rem;
    z-index: 2;
    position: relative;
}

.main-character-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #f39c12;
    object-fit: cover;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.sub-character-images {
    display: flex;
    gap: 0.5rem;
}

.sub-character-image {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #f39c12;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Info Section */
.info-section {
    flex-grow: 1;
    z-index: 2;
    position: relative;
    margin-bottom: 0.75rem;
}

.info-item {
    margin-bottom: 0.5rem;
}

.info-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #f39c12;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Comment Section */
.comment-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-top: auto;
    z-index: 2;
    position: relative;
    backdrop-filter: blur(10px);
}

.comment-content {
    font-size: 0.875rem;
    line-height: 1.4;
    font-style: italic;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Download Section */
.download-section {
    text-align: center;
    margin-top: 1rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.3s ease-in-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #ffffff;
    border-radius: 8px;
    padding: 2rem;
    max-width: 80%;
    max-height: 80%;
    overflow: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalScaleIn 0.3s ease-in-out;
}

@keyframes modalScaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    margin-bottom: 1rem;
    text-align: center;
}

.modal-header h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.modal-header p {
    color: #6c757d;
    font-size: 0.875rem;
}

.image-container {
    max-width: 100%;
    max-height: 400px;
    overflow: hidden;
    margin-bottom: 1rem;
    text-align: center;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 767px) {
    .app-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem;
    }
    
    .app-header h1 {
        font-size: 1.5rem;
    }
    
    .profile-card {
        width: 280px;
        min-height: 450px;
        padding: 1rem;
    }
    
    .main-character-image {
        width: 100px;
        height: 100px;
    }
    
    .sub-character-image {
        width: 40px;
        height: 40px;
    }
    
    .hardware-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sub-images-container {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        max-width: 95%;
        padding: 1rem;
    }
}
