/**
 * GOES スケジュール生成システム - フロントエンドCSS
 * 学習塾ゴーズ専用
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --goes-primary: #1a5276;
    --goes-primary-dark: #154360;
    --goes-primary-light: #2980b9;
    --goes-secondary: #27ae60;
    --goes-secondary-dark: #1e8449;
    --goes-accent: #f39c12;
    --goes-danger: #e74c3c;
    --goes-gray-100: #f8f9fa;
    --goes-gray-200: #e9ecef;
    --goes-gray-300: #dee2e6;
    --goes-gray-400: #ced4da;
    --goes-gray-500: #adb5bd;
    --goes-gray-600: #6c757d;
    --goes-gray-700: #495057;
    --goes-gray-800: #343a40;
    --goes-gray-900: #212529;
    --goes-white: #ffffff;
    --goes-black: #000000;
    --goes-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --goes-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --goes-radius: 8px;
    --goes-radius-sm: 4px;
    --goes-transition: 0.3s ease;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
.goes-form-container,
.goes-schedule-form-container,
.goes-inquiry-form-container,
.goes-login-form,
.goes-register-form,
.goes-mypage,
.goes-schedule-detail,
.goes-schedule-history,
.goes-student-password-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: var(--goes-white);
    border-radius: var(--goes-radius);
    box-shadow: var(--goes-shadow);
}

/* ==========================================================================
   Form Styles
   ========================================================================== */
.goes-form {
    margin: 0;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--goes-gray-200);
}

.form-header h2 {
    color: var(--goes-primary);
    margin-bottom: 10px;
    font-size: 1.8em;
}

.form-header p {
    color: var(--goes-gray-600);
    margin: 0;
}

.form-header .student-badge {
    display: inline-block;
    background: var(--goes-secondary);
    color: var(--goes-white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    margin-top: 10px;
}

.form-header .price-info {
    font-size: 1.2em;
    color: var(--goes-primary);
    font-weight: bold;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--goes-gray-200);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.form-section h3 {
    color: var(--goes-gray-800);
    font-size: 1.2em;
    margin-bottom: 20px;
    padding-left: 10px;
    border-left: 4px solid var(--goes-primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--goes-gray-700);
}

.form-group label .required {
    color: var(--goes-danger);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--goes-gray-300);
    border-radius: var(--goes-radius-sm);
    font-size: 1em;
    transition: border-color var(--goes-transition), box-shadow var(--goes-transition);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--goes-primary);
    box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--goes-gray-500);
    font-size: 0.85em;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row.two-columns .form-group {
    flex: 1;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Checkbox & Radio Groups */
.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background: var(--goes-gray-100);
    border: 1px solid var(--goes-gray-300);
    border-radius: var(--goes-radius-sm);
    cursor: pointer;
    transition: all var(--goes-transition);
    font-weight: normal;
}

.checkbox-label:hover,
.radio-label:hover {
    background: var(--goes-gray-200);
}

.checkbox-label input,
.radio-label input {
    margin-right: 8px;
}

.checkbox-label input:checked + span,
.radio-label input:checked + span {
    color: var(--goes-primary);
}

/* Form Actions */
.form-actions {
    text-align: center;
    margin-top: 30px;
}

/* Form Messages */
.form-message {
    padding: 15px 20px;
    border-radius: var(--goes-radius-sm);
    margin-top: 20px;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 12px 25px;
    font-size: 1em;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--goes-radius-sm);
    cursor: pointer;
    transition: all var(--goes-transition);
}

.btn-primary {
    background: var(--goes-primary);
    color: var(--goes-white);
}

.btn-primary:hover {
    background: var(--goes-primary-dark);
    color: var(--goes-white);
}

.btn-secondary {
    background: var(--goes-gray-200);
    color: var(--goes-gray-700);
}

.btn-secondary:hover {
    background: var(--goes-gray-300);
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1em;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   Schedule Table
   ========================================================================== */
.goes-schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.95em;
}

.goes-schedule-table th,
.goes-schedule-table td {
    padding: 12px 10px;
    border: 1px solid var(--goes-gray-300);
    text-align: left;
}

.goes-schedule-table th {
    background: var(--goes-primary);
    color: var(--goes-white);
    font-weight: 600;
    text-align: center;
}

.goes-schedule-table .col-date {
    width: 110px;
    text-align: center;
}

.goes-schedule-table .col-pages {
    width: 100px;
    text-align: center;
}

.goes-schedule-table .col-unit {
    min-width: 150px;
}

.goes-schedule-table .col-checkbox {
    width: 50px;
    text-align: center;
}

.goes-schedule-table .col-note {
    width: 120px;
}

.goes-schedule-table .col-note input {
    width: 100%;
    padding: 5px;
    border: 1px solid var(--goes-gray-300);
    border-radius: 3px;
    font-size: 0.9em;
}

.goes-schedule-table .reserve-day {
    background: var(--goes-gray-100);
    color: var(--goes-gray-500);
}

.goes-schedule-table .reserve-day td {
    font-style: italic;
}

.goes-schedule-table tbody tr:hover {
    background: rgba(26, 82, 118, 0.03);
}

/* ==========================================================================
   Schedule Preview
   ========================================================================== */
#schedule-preview {
    background: var(--goes-gray-100);
    padding: 20px;
    border-radius: var(--goes-radius);
    margin-top: 20px;
}

#schedule-preview h3 {
    margin-top: 0;
    color: var(--goes-gray-700);
}

.preview-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.preview-info p {
    margin: 0;
    padding: 10px;
    background: var(--goes-white);
    border-radius: var(--goes-radius-sm);
}

.preview-info strong {
    color: var(--goes-primary);
    font-size: 1.2em;
}

/* ==========================================================================
   Schedule Result
   ========================================================================== */
#schedule-result {
    animation: fadeIn 0.5s ease;
}

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

.result-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #d4edda;
    border-radius: var(--goes-radius);
}

.result-header h3 {
    color: #155724;
    margin-bottom: 20px;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ==========================================================================
   Schedule Detail
   ========================================================================== */
.goes-schedule-detail .schedule-header {
    margin-bottom: 30px;
}

.goes-schedule-detail .schedule-meta {
    background: var(--goes-gray-100);
    padding: 20px;
    border-radius: var(--goes-radius);
    margin: 20px 0;
}

.goes-schedule-detail .schedule-meta p {
    margin: 5px 0;
}

.goes-schedule-detail .schedule-actions {
    margin-top: 20px;
}

/* ==========================================================================
   Schedule History
   ========================================================================== */
.goes-schedule-history h3 {
    color: var(--goes-primary);
    margin-bottom: 20px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 12px 10px;
    border: 1px solid var(--goes-gray-300);
    text-align: left;
}

.history-table th {
    background: var(--goes-gray-100);
    font-weight: 600;
}

.history-table tbody tr:hover {
    background: var(--goes-gray-100);
}

/* ==========================================================================
   Textbook List
   ========================================================================== */
.goes-textbook-list {
    margin: 20px 0;
}

.textbook-group {
    margin-bottom: 30px;
}

.subject-title {
    color: var(--goes-primary);
    font-size: 1.1em;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--goes-primary);
    margin-bottom: 15px;
}

.textbook-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.textbook-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--goes-gray-100);
    border-radius: var(--goes-radius-sm);
}

.textbook-info {
    flex: 1;
}

.textbook-name {
    font-weight: 600;
    color: var(--goes-gray-800);
}

.textbook-pages {
    color: var(--goes-gray-500);
    font-size: 0.9em;
    margin-left: 10px;
}

.amazon-link {
    display: inline-block;
    padding: 8px 15px;
    background: #ff9900;
    color: var(--goes-white);
    text-decoration: none;
    border-radius: var(--goes-radius-sm);
    font-size: 0.85em;
    font-weight: 600;
    transition: background var(--goes-transition);
}

.amazon-link:hover {
    background: #e68a00;
    color: var(--goes-white);
}

/* ==========================================================================
   Login / Register Forms
   ========================================================================== */
.goes-login-form,
.goes-register-form {
    max-width: 450px;
}

.goes-login-form h3,
.goes-register-form h3 {
    text-align: center;
    color: var(--goes-primary);
    margin-bottom: 30px;
}

.form-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--goes-gray-200);
}

.form-links a {
    color: var(--goes-primary);
    text-decoration: none;
}

.form-links a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   MyPage
   ========================================================================== */
.goes-mypage .mypage-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--goes-gray-200);
}

.goes-mypage .mypage-header h2 {
    color: var(--goes-primary);
    margin-bottom: 10px;
}

.mypage-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mypage-section h3 {
    color: var(--goes-gray-700);
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid var(--goes-primary);
}

.account-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.account-links li {
    padding: 10px 0;
    border-bottom: 1px solid var(--goes-gray-200);
}

.account-links a {
    color: var(--goes-primary);
    text-decoration: none;
}

.account-links a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Student Password Form
   ========================================================================== */
.goes-student-password-form {
    max-width: 450px;
    text-align: center;
}

.goes-student-password-form h3 {
    color: var(--goes-primary);
    margin-bottom: 15px;
}

.goes-student-password-form p {
    color: var(--goes-gray-600);
    margin-bottom: 25px;
}

/* ==========================================================================
   Inquiry Form Specific
   ========================================================================== */
.goes-inquiry-form-container .subjects-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (max-width: 600px) {
    .goes-inquiry-form-container .subjects-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

.privacy-section {
    background: var(--goes-gray-100);
    padding: 20px;
    border-radius: var(--goes-radius);
}

.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.success-message h3 {
    color: var(--goes-secondary);
    margin-bottom: 15px;
}

.success-actions {
    margin-top: 30px;
}

.contact-info {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--goes-gray-200);
}

.contact-info h4 {
    color: var(--goes-gray-700);
    margin-bottom: 15px;
}

.contact-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-info li {
    padding: 8px 0;
}

.contact-info a {
    color: var(--goes-primary);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Notices
   ========================================================================== */
.goes-notice {
    padding: 15px 20px;
    background: var(--goes-gray-100);
    border-left: 4px solid var(--goes-gray-400);
    border-radius: var(--goes-radius-sm);
    color: var(--goes-gray-600);
}

.goes-error {
    padding: 15px 20px;
    background: #f8d7da;
    border-left: 4px solid var(--goes-danger);
    border-radius: var(--goes-radius-sm);
    color: #721c24;
}

.goes-login-required {
    text-align: center;
    padding: 40px 20px;
    background: var(--goes-gray-100);
    border-radius: var(--goes-radius);
}

.goes-login-required p {
    margin-bottom: 20px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .goes-form-container,
    .goes-schedule-form-container,
    .goes-inquiry-form-container,
    .goes-login-form,
    .goes-register-form,
    .goes-mypage,
    .goes-schedule-detail,
    .goes-schedule-history,
    .goes-student-password-form {
        padding: 20px 15px;
        margin: 10px;
        border-radius: var(--goes-radius-sm);
    }
    
    .form-header h2 {
        font-size: 1.5em;
    }
    
    .goes-schedule-table {
        font-size: 0.85em;
    }
    
    .goes-schedule-table th,
    .goes-schedule-table td {
        padding: 8px 5px;
    }
    
    .goes-schedule-table .col-note {
        display: none;
    }
    
    .preview-info {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions .btn {
        width: 100%;
    }
}
