/**
 * Bruecke - 共通スタイルシート
 * 音楽広場ブリュッケ 音楽室予約システム
 * 
 * デザインガイドライン準拠
 * @see docs/design_guideline.md
 */

/* ===== Scroll Behavior ===== */
html {
    scroll-padding-top: 80px; /* ヘッダー高さ分のpadding */
    scroll-behavior: smooth; /* スムーズスクロール */
}

/* ===== CSS Variables ===== */
:root {
    /* Colors - Main (空の青) */
    --color-background: #E3F4FF;
    --color-primary-light: #A8D8EA;
    --color-primary: #6CB4EE;
    --color-primary-dark: #4A90E2;
    
    /* Colors - Text */
    --color-text: #333333;
    --color-text-light: #666666;
    --color-text-placeholder: #999999;
    
    /* Colors - System */
    --color-success: #4CAF50;
    --color-warning: #FF9800;
    --color-error: #F44336;
    --color-info: #2196F3;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;
    --spacing-2xl: 40px;
    
    /* Container Widths */
    --width-form: 450px;
    --width-detail: 800px;
    --width-dashboard: 1200px;
    
    /* Border Radius */
    --radius-sm: 5px;
    --radius-md: 10px;
    --radius-lg: 20px;
    
    /* Shadows */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-primary: 0 5px 15px rgba(108, 180, 238, 0.4);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-index Layers */
    --z-dropdown: 1000;
    --z-modal: 5000;
    --z-toast: 9999;
}

/* ===== Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== Base Styles ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 16px;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

div#content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-text);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--spacing-lg);
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 24px;
    font-weight: 600;
}

h3 {
    font-size: 20px;
}

p {
    margin-bottom: var(--spacing-md);
}

form {
    margin-bottom: var(--spacing-md);
}

.required::after {
    display: inline;
    content: "*";
    color: var(--color-error);
}

/* ===== Layout Containers ===== */
.page-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
}

/* ===== Form Elements ===== */
/* ===== Buttons ===== */
button,
.btn {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all var(--transition-normal);
    line-height: 1;
}

button:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Secondary Button */
.btn-secondary {
    background-color: white;
    color: var(--color-primary-dark);
    border: 2px solid var(--color-primary-dark);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-primary-dark);
    color: white;
}

/* Danger Button */
.btn-danger {
    background-color: var(--color-error);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

/* Success Button */
.btn-success {
    background-color: var(--color-success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

/* ===== Modal & Dialog ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--z-modal);
    padding: var(--spacing-lg);
    animation: fadeIn 0.3s ease;
}

.modal-overlay.hiding {
    animation: fadeOut 0.3s ease;
}

.modal {
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    animation: scaleIn 0.3s ease;
}

.modal.hiding {
    animation: scaleOut 0.3s ease;
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 2px solid var(--color-primary-light);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.modal-body {
    padding: var(--spacing-md);
    color: var(--color-text-light);
    line-height: 1.6;
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.text-muted {
    color: var(--color-text-light);
}

.text-small {
    font-size: 12px;
}

.text-success {
    color: var(--color-success);
}

.text-error {
    color: var(--color-error);
}

.text-warning {
    color: var(--color-warning);
}

.text-info {
    color: var(--color-info);
}

/* Modal/Dialog */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-dialog {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    padding: var(--spacing-xl);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.modal-body {
    /* margin-bottom: var(--spacing-xl); */
    color: var(--color-text-light);
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn-cancel {
    background-color: white;
    color: var(--color-text);
    border: 2px solid #E0E0E0;
}

.modal-btn-cancel:hover {
    background-color: #F5F5F5;
}

.modal-btn-confirm {
    background-color: var(--color-error);
    color: white;
}

.modal-btn-confirm:hover {
    background-color: #D32F2F;
}

.modal-btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.modal-btn-primary:hover {
    background-color: var(--color-primary-dark);
}

/* ===== Flash Messages ===== */
.flash-message-container {
    text-align: center;
}

.flash-message {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 15px 20px;
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    max-width: 600px;
    width: 100%;
}

.flash-message::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 18px;
    flex-shrink: 0;
}

.flash-success {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.flash-success::before {
    content: '\f058'; /* fa-check-circle */
    color: var(--color-success);
}

.flash-error {
    background-color: #FFEBEE;
    color: #C62828;
}

.flash-error::before {
    content: '\f06a'; /* fa-exclamation-circle */
    color: var(--color-error);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-toast);
    pointer-events: none;
}

.toast {
    padding: 15px 20px;
    margin-bottom: var(--spacing-sm);
    border-radius: var(--radius-md);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 600;
    min-width: 250px;
    max-width: 400px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background-color: white;
    color: var(--color-text);
    border-left: 4px solid;
}

.toast.hiding {
    animation: slideOutRight 0.3s ease;
}

.toast-success {
    border-left-color: var(--color-success);
}

.toast-success .toast-icon {
    color: var(--color-success);
}

.toast-error {
    border-left-color: var(--color-error);
}

.toast-error .toast-icon {
    color: var(--color-error);
}

.toast-warning {
    border-left-color: var(--color-warning);
}

.toast-warning .toast-icon {
    color: var(--color-warning);
}

.toast-info {
    border-left-color: var(--color-info);
}

.toast-info .toast-icon {
    color: var(--color-info);
}

.toast-icon {
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: var(--color-text);
}

.toast-close {
    background: none;
    border: none;
    color: var(--color-text-light);
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    width: 20px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.toast-close:hover {
    opacity: 1;
    color: var(--color-text);
}

/* ===== Spinner (Loading) ===== */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.spinner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-primary-dark);
    font-size: 14px;
    font-weight: 500;
}

.spinner i {
    font-size: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===== Tailwind-like Utility Classes ===== */

/* Width */
.w-full { width: 100%; }
.w-15 { width: 60px; }
.max-w-xs { max-width: 320px; }
.max-w-3xl { max-width: 800px; }
.max-w-4xl { max-width: 900px; }
.max-w-5xl { max-width: 1000px; }
.max-w-7xl { max-width: 1200px; }
.min-w-\[200px\] { min-width: 200px; }

/* Height */
.h-15 { height: 60px; }
.min-h-screen { min-height: 100vh; }

/* Margin & Padding */
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-8 { margin-bottom: 32px; }
.mb-10 { margin-bottom: 40px; }
.mt-5 { margin-top: 20px; }
.p-8 { padding: 32px; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.px-8 { padding-left: 32px; padding-right: 32px; }
.px-10 { padding-left: 40px; padding-right: 40px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-15 { padding-top: 60px; padding-bottom: 60px; }
.py-20 { padding-top: 80px; padding-bottom: 80px; }
.py-25 { padding-top: 100px; padding-bottom: 100px; }
.py-30 { padding-top: 120px; padding-bottom: 120px; }

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.flex-shrink-0 { flex-shrink: 0; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-8 { gap: 32px; }

/* Text */
.text-center { text-align: center; }
.text-sm { font-size: 14px; }
.text-base { font-size: 16px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 28px; }
.text-4xl { font-size: 32px; }
.text-5xl { font-size: 48px; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.7; }
.underline { text-decoration: underline; }

/* Colors */
.text-white { color: white; }
.text-gray-600 { color: #666666; }
.text-gray-800 { color: #333333; }
.text-blue-500 { color: #6CB4EE; }
.text-blue-600 { color: #4A90E2; }
.text-green-500 { color: #4CAF50; }
.bg-white { background-color: white; }
.bg-sky-100 { background-color: #E3F4FF; }
.bg-blue-500 { background-color: #6CB4EE; }
.bg-blue-600 { background-color: #4A90E2; }
.bg-blue-700 { background-color: #2563eb; }
.border-blue-600 { border-color: #4A90E2; }
.border-2 { border-width: 2px; }

/* Border Radius */
.rounded-lg { border-radius: 10px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 20px; }
.rounded-full { border-radius: 9999px; }

/* Shadow */
.shadow-sm { box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15); }

/* Transform */
.transform { transform: translateZ(0); }
.rotate-90 { transform: rotate(90deg); }
.-translate-y-1 { transform: translateY(-4px); }

/* Transition */
.transition-all { transition: all 0.3s ease; }
.transition-colors { transition: color 0.2s ease; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

/* Hover states */
.hover\:bg-blue-600:hover { background-color: #4A90E2; }
.hover\:bg-blue-700:hover { background-color: #2563eb; }
.hover\:text-white:hover { color: white; }
.hover\:text-sky-100:hover { color: #E3F4FF; }
.hover\:-translate-y-1:hover { transform: translateY(-4px); }
.hover\:shadow-md:hover { box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); }
.hover\:shadow-lg:hover { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1); }
.hover\:shadow-xl:hover { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15); }

/* Display */
.inline-block { display: inline-block; }

/* Responsive - Small screens (min-width: 480px) */
@media (min-width: 480px) {
    .sm\:w-auto { width: auto; }
    .sm\:flex-row { flex-direction: row; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:text-2xl { font-size: 24px; }
    .sm\:text-4xl { font-size: 36px; }
}

/* Responsive - Large screens (min-width: 768px) */
@media (min-width: 768px) {
    .md\:px-8 { padding-left: 32px; padding-right: 32px; }
    .md\:px-10 { padding-left: 40px; padding-right: 40px; }
    .md\:py-20 { padding-top: 80px; padding-bottom: 80px; }
    .md\:py-25 { padding-top: 100px; padding-bottom: 100px; }
    .lg\:flex-row { flex-direction: row; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:gap-8 { gap: 32px; }
    .lg\:py-25 { padding-top: 100px; padding-bottom: 100px; }
    .lg\:py-30 { padding-top: 120px; padding-bottom: 120px; }
    .lg\:text-5xl { font-size: 42px; }
    .lg\:rotate-0 { transform: rotate(0deg); }
}
