/* Main Styles */
:root {
    --primary-color: #2F80ED;
    --secondary-color: #333333;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Override Bootstrap Primary Color */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

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

.btn-primary:hover {
    background-color: rgba(var(--primary-color), 0.8);
    border-color: rgba(var(--primary-color), 0.8);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Authentication Pages */
.auth-container {
    max-width: 450px;
    margin: 2rem auto;
}

.auth-card {
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.auth-header {
    background-color: var(--primary-color);
    color: white;
    border-radius: 1rem 1rem 0 0;
    padding: 1.5rem;
    text-align: center;
}

.auth-header img {
    width: 150px;
    height: 150px;
    object-fit: contain;
}

/* ログインページのレスポンシブ調整 */
@media (max-width: 576px) {
    .auth-container {
        max-width: 100%;
        margin: 1rem 0.5rem;
        padding: 0 0.5rem;
    }
    
    .auth-card {
        border-radius: 0.75rem;
    }
    
    .auth-header {
        padding: 1.25rem 1rem;
    }
    
    .auth-header img {
        height: 40px !important;
    }
}

/* Dashboard Styles */
.dashboard-stat-card {
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.dashboard-stat-card .icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.dashboard-stat-card .stat {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

/* Attendance Page */
.time-display {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1rem;
}

.clock-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.attendance-record {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.attendance-record.clock-in {
    border-color: var(--success-color);
}

.attendance-record.clock-out {
    border-color: var(--danger-color);
}

.attendance-record.break-start {
    border-color: var(--warning-color);
}

.attendance-record.break-end {
    border-color: var(--info-color);
}

/* Admin Panel */
.admin-sidebar {
    background-color: var(--light-color);
    border-radius: 0.5rem;
    padding: 1rem;
}

.admin-sidebar .nav-link {
    color: var(--dark-color);
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
}

.admin-sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.admin-sidebar .nav-link:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

.admin-sidebar .nav-link i {
    width: 1.5rem;
    text-align: center;
}

/* AI Assistant Floating Character */
.ai-assistant-container {
    position: fixed;
    top: 120px;
    right: 20px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    transition: all 0.5s ease;
}

/* Full screen mode positioning */
.ai-assistant-container.fullscreen {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.75);
    align-items: center;
    justify-content: center;
}

.ai-assistant-character {
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.fullscreen .ai-assistant-character {
    opacity: 0.3;
    position: absolute;
    right: 20px;
    bottom: 20px;
    animation: none;
    z-index: 0;
}

.ai-assistant-character:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3));
}

.ai-assistant-bubble {
    width: 300px;
    background-color: white;
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    position: relative;
    display: none;
    transform-origin: right bottom;
    animation: popup 0.3s ease-out forwards;
    transition: all 0.5s ease;
    z-index: 1050;
}

.fullscreen .ai-assistant-bubble {
    width: 95vw;
    max-width: 1500px;
    height: 95vh;
    max-height: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    transform-origin: center;
}

.ai-assistant-bubble.show {
    display: block;
}

.fullscreen .ai-assistant-bubble.show {
    display: flex;
}

.ai-assistant-bubble:after {
    content: '';
    position: absolute;
    right: 20px;
    bottom: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
    transition: opacity 0.3s ease;
}

.fullscreen .ai-assistant-bubble:after {
    opacity: 0;
}

.ai-assistant-bubble h5 {
    margin-top: 0;
    padding: 8px 12px;
    color: white;
    font-size: 1.1rem;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fullscreen .ai-assistant-bubble h5 {
    padding: 12px 20px;
    font-size: 1.3rem;
}

.ai-assistant-messages {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 10px;
    flex-grow: 1;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.ai-assistant-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-assistant-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-assistant-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.fullscreen .ai-assistant-messages {
    max-height: calc(95vh - 140px);
    padding: 15px;
    width: 100%;
}

.ai-message {
    background-color: #f0f7ff;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    display: inline-block;
    max-width: 95%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.5;
    font-size: 0.95rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.fullscreen .ai-message {
    padding: 16px 20px;
    margin-bottom: 15px;
    max-width: 90%;
    max-height: none;
    font-size: 1rem;
    line-height: 1.6;
}

.ai-message.error {
    background-color: #ffe5e5;
}

.typing-indicator {
    background-color: #f0f7ff;
    padding: 12px 16px;
    display: inline-block;
}

.typing-indicator span {
    display: inline-block;
    animation: typingDots 1.4s infinite;
}

@keyframes typingDots {
    0%, 20% {
        content: ".";
    }
    40% {
        content: "..";
    }
    60%, 100% {
        content: "...";
    }
}

.user-message {
    background-color: #e9ecef;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    margin-left: auto;
    display: inline-block;
    text-align: right;
    max-width: 95%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.5;
    font-size: 0.95rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.fullscreen .user-message {
    padding: 16px 20px;
    margin-bottom: 15px;
    max-width: 90%;
    max-height: none;
    font-size: 1rem;
    line-height: 1.6;
}

.ai-assistant-input {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.fullscreen .ai-assistant-input {
    padding: 15px;
}

.ai-assistant-input input {
    flex-grow: 1;
    border-radius: 20px;
    border: 1px solid #ced4da;
    padding: 6px 12px;
}

.fullscreen .ai-assistant-input input {
    padding: 10px 16px;
    font-size: 1.1rem;
}

.ai-assistant-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.fullscreen .ai-assistant-controls {
    padding: 0 15px 15px;
}

.ai-assistant-controls button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--primary-color);
}

.fullscreen .ai-assistant-controls button {
    font-size: 1.4rem;
}

.ai-assistant-controls .btn-voice {
    color: var(--primary-color);
}

.ai-assistant-controls .btn-close,
.ai-assistant-controls .btn-fullscreen {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.fullscreen .ai-assistant-controls .btn-close,
.fullscreen .ai-assistant-controls .btn-fullscreen {
    font-size: 1.2rem;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes popup {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* クイックアクションアイコンのサイズ調整 */
.quick-actions .action-icon {
    font-size: 2.1rem; /* 約70%に縮小 (元は3rem程度) */
    margin-bottom: 0.5rem;
}

/* 保存ボタンを目立たせる */
.btn-save {
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 120px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .clock-buttons {
        flex-direction: column;
    }
    
    .time-display {
        font-size: 2.5rem;
    }
    
    .ai-assistant-container {
        top: auto;
        bottom: 20px;
    }
    
    .ai-assistant-character {
        width: 60px;
        height: 60px;
    }
    
    .ai-assistant-bubble {
        width: 250px;
    }
    
    .fullscreen .ai-assistant-bubble {
        width: 100vw;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
    
    .fullscreen .ai-assistant-messages {
        padding: 10px;
        max-height: calc(100vh - 140px);
    }
    
    .fullscreen .ai-message,
    .fullscreen .user-message {
        max-width: 95%;
        max-height: none;
    }
    
    /* ナビゲーションの調整 - タブレット向け */
    .navbar-brand {
        margin-right: 0.5rem;
    }
    
    /* フッターのレスポンシブ対応強化 */
    footer .text-md-start,
    footer .text-md-end {
        text-align: center !important;
    }
    
    footer .col-md-6:first-child {
        margin-bottom: 1rem;
    }
}