/* 
 * Style for Academic Portal App (izumi-c.ac.jp)
 * Designed with modern Glassmorphism, Dark mode defaults, and fluid gradients.
 */

:root {
    /* Color Palette */
    --bg-dark: #0f121d;
    --bg-card: rgba(23, 28, 48, 0.45);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    
    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.35);
    
    --success: #10b981; /* Emerald */
    --success-bg: rgba(16, 185, 129, 0.1);
    --success-border: rgba(16, 185, 129, 0.3);
    
    --warning: #f59e0b; /* Amber */
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-border: rgba(245, 158, 11, 0.3);
    
    --danger: #ef4444; /* Rose */
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-border: rgba(239, 68, 68, 0.4);
    --danger-glow: rgba(239, 68, 68, 0.25);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    
    --font-family: 'Plus Jakarta Sans', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Background Blur Circles Effect */
.bg-blur-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blur-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.45;
    mix-blend-mode: screen;
}

.circle-1 {
    top: -10%;
    left: 10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.6) 0%, rgba(139, 92, 246, 0.1) 70%);
    animation: float-slow 25s infinite alternate ease-in-out;
}

.circle-2 {
    bottom: -10%;
    right: 5%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.5) 0%, rgba(59, 130, 246, 0.1) 70%);
    animation: float-slow 20s infinite alternate-reverse ease-in-out 2s;
}

.circle-3 {
    top: 40%;
    left: 45%;
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.4) 0%, rgba(99, 102, 241, 0.0) 70%);
    animation: float-slow 30s infinite alternate ease-in-out 5s;
}

@keyframes float-slow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(8%, 10%) scale(1.15); }
}

/* Layout Container */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

/* Glassmorphism Panel Class */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: var(--border-hover);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Screen Panel Toggle System */
.screen-panel {
    width: 100%;
    max-width: 480px;
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: none;
}

.screen-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.screen-panel.hidden {
    display: none;
}

/* 1. LOGIN SCREEN CARD SPECIFICS */
.card {
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
}

.logo-area {
    margin-bottom: 32px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    animation: pulse-logo 4s infinite ease-in-out;
}

.logo-icon img,
.logo-icon svg {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

@keyframes pulse-logo {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 30px rgba(99, 102, 241, 0.6);
    }
}

.logo-area h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    color: var(--text-main);
}

.logo-area .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.login-instruction {
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}

.domain-highlight {
    color: #a5b4fc;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Alert Boxes (Errors, Warnings) */
.alert-box {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 24px;
    text-align: left;
    font-size: 13px;
    line-height: 1.5;
    animation: slide-down 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.alert-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.alert-icon svg {
    width: 20px;
    height: 20px;
}

.alert-box.error {
    background-color: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: #fecdd3;
    box-shadow: 0 4px 12px var(--danger-glow);
}

.alert-box.hidden {
    display: none;
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shake {
    animation: shake-anim 0.4s ease-in-out;
}

@keyframes shake-anim {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Action areas */
.auth-action-area {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

#google-btn-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.card-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

/* 2. DASHBOARD SCREEN SPECIFICS */
#dashboard-screen {
    max-width: 960px;
}

.dashboard-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
}

.dash-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mini-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    -webkit-text-fill-color: initial;
}

.user-status-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 18, 29, 0.5);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 40px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid var(--primary);
    background-color: var(--bg-dark);
}

.user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

.user-email-text {
    font-size: 11px;
    color: var(--text-muted);
}

.logout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.logout-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.logout-btn svg {
    width: 18px;
    height: 18px;
}

/* Dashboard Content */
.dash-content {
    padding: 32px;
}

/* Welcome Banner Layout */
.welcome-banner {
    background: radial-gradient(80% 120% at 0% 0%, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 20px;
    padding: 24px 28px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    padding-right: 48px; /* ×ボタン用の余白 */
}

.banner-left {
    flex: 1;
    min-width: 260px;
    /* スマホ表示時の文字あふれ防止と折り返し */
    word-break: break-word;
    overflow-wrap: break-word;
}

.banner-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.banner-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: var(--transition-smooth);
}

.banner-close-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--border-hover);
    transform: rotate(90deg);
}

/* 「こんにちは、●●さん！」のサイズを下と同一(14px)に統一 */
.welcome-user-line {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-main);
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: break-word;
}

.welcome-user-line span {
    color: #a5b4fc;
}

.welcome-message-body {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Job Search Area Layout */
.job-search-section {
    display: grid;
    grid-template-columns: 1.2fr 1.1fr;
    gap: 24px;
    margin-top: 10px;
}

@media (max-width: 868px) {
    .job-search-section {
        grid-template-columns: 1fr;
    }
    .dash-content {
        padding: 20px 16px;
    }
    .welcome-banner {
        padding: 18px 20px;
        padding-right: 44px;
    }
}

.search-menu-card, .search-detail-card {
    padding: 28px;
    height: auto;
}

.search-menu-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    color: var(--text-main);
    transition: var(--transition-smooth);
    width: 100%;
}

.menu-item:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateX(4px);
}

.menu-item.active {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.menu-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.menu-item.active .menu-number {
    background: var(--primary);
    color: white;
}

.menu-details {
    display: flex;
    flex-direction: column;
}

.menu-title {
    font-size: 14px;
    font-weight: 600;
}

.menu-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Search Form Styles */
.search-form-container {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.search-form {
    display: none;
    animation: fade-in-up 0.4s ease;
}

.search-form.active {
    display: block;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-form label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.styled-select, .styled-input {
    width: 100%;
    background: rgba(15, 18, 29, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-main);
    transition: var(--transition-smooth);
}

.styled-select:focus, .styled-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.styled-select option, .styled-select optgroup {
    background: var(--bg-dark);
    color: var(--text-main);
}

.new-jobs-badge {
    display: inline-block;
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.new-jobs-info {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.search-actions {
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: white;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--primary-glow);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
    filter: brightness(1.1);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    padding: 14px 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

/* Search Results Container */
.search-results-container {
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    animation: fade-in-up 0.4s ease;
    text-align: left;
}

.search-results-container.hidden {
    display: none;
}

.results-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.results-title-bar h4 {
    font-size: 14px;
    font-weight: 700;
    color: #a5b4fc;
}

.back-to-menu-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.back-to-menu-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    color: var(--text-main);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.results-list::-webkit-scrollbar {
    width: 6px;
}
.results-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}
.results-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.results-list::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.3);
}

.result-item {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: var(--transition-smooth);
}

.result-item:hover {
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.03);
    transform: translateY(-2px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.result-facility {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.result-badge {
    font-size: 10px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid var(--success-border);
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
}

.result-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.result-row {
    display: flex;
}

.result-row .label {
    width: 70px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.result-row .value {
    color: var(--text-main);
}

.no-results {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 24px 0;
}

/* 気になる求人（お気に入り）チェックボックス */
.fav-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.fav-checkbox-label:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.fav-checkbox {
    cursor: pointer;
    accent-color: #f59e0b;
}

.fav-checkbox:checked + .fav-star {
    color: #fbbf24;
    font-weight: bold;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 11, 18, 0.7);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.modal-card {
    width: 90%;
    max-width: 680px;
    padding: 32px;
    text-align: left;
}

.icon-btn {
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
}

/* Floating back-to-top button */
.floating-menu-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    z-index: 90;
    transition: var(--transition-smooth);
}

.floating-menu-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.floating-menu-btn.hidden {
    display: none;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(15, 18, 29, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    padding: 14px 20px;
    border-radius: 12px;
    color: var(--text-main);
    font-size: 13px;
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: var(--transition-smooth);
}

@keyframes toast-in {
    from { transform: translateY(20px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.toast.toast-error {
    border-left: 4px solid var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.toast.toast-success {
    border-left: 4px solid var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.toast.fade-out {
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
}
