/* public/css/main.css - Global styles */

:root {
    --color-bg: #1a1a2e;
    --color-bg-secondary: #16213e;
    --color-surface: #0f3460;
    --color-primary: #e94560;
    --color-primary-dark: #c81e45;
    --color-accent: #533483;
    --color-text: #eee;
    --color-text-muted: #ffffff;
    --color-success: #2ecc71;
    --color-danger: #e74c3c;
    --color-warning: #f39c12;
    --color-info: #3498db;
    --color-night: #0a0a1a;
    --color-day: #f0e6d3;
    --color-wolf: #e74c3c;
    --color-villager: #2ecc71;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --font: 'Segoe UI', 'Microsoft JhengHei', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.bg {
    background-image: url('../images/BG.png');
    background-size: cover;
    background-position: center;
}

.bg1 {
    background-image: url('../images/BG1.png');
    background-size: cover;
    background-position: center;
}

.bg2 {
    background-image: url('../images/BG2.png');
    background-size: cover;
    background-position: center;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
    }

    to {
        box-shadow: 0 0 20px rgba(255, 0, 0, 1);
    }
}

.glow {
    background: hsl(49, 100%, 55%);
    color: white;
    padding: 12px;
    border-radius: 20px;
    text-align: center;

    animation: glow 1s infinite alternate;
}

.floating {
    width: 200px;
    height: 100px;

    text-align: center;
    line-height: 100px;
    border-radius: 10px;

    /* 套用動畫 */
    animation: floatUpDown 3s ease-in-out infinite;
}

@keyframes floatUpDown {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }

    /* 上浮 */
    100% {
        transform: translateY(0);
    }

    /* 回到原位 */
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

h1,
h2,
h3 {
    font-weight: 600;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-align: center;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.97);
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.btn-success {
    background: var(--color-success);
    color: #fff;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--color-primary);
    color: #fff;
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #333;
    border-radius: var(--radius);
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-size: 1rem;
    font-family: var(--font);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Cards */
.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.8rem;
    box-shadow: var(--shadow);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius);
    color: #fff;
    font-size: 0.9rem;
    animation: toastIn 0.3s ease;
    max-width: 320px;
}

.toast.success {
    background: var(--color-success);
}

.toast.error {
    background: var(--color-danger);
}

.toast.info {
    background: var(--color-info);
}

.toast.warning {
    background: var(--color-warning);
    color: #000;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Utility */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-text-muted);
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
}

.modal {
    background: var(--color-bg-secondary);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Page wrapper */
.page {
    display: none;
}

.page.active {
    display: block;
}