/* GameWith Inspired Clean UI */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

:root {
    --primary-blue: #007bff;
    --secondary-blue: #0056b3;
    --accent-green: #28a745;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #343a40;
    --white: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
    --border: #dee2e6;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-gray);
    color: var(--dark-gray);
    line-height: 1.6;
}

header {
    background-color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px var(--shadow);
    border-bottom: 1px solid var(--border);
}

h1 {
    margin: 0;
    color: var(--primary-blue);
    font-size: 1.8rem;
    font-weight: 700;
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#auth-nav {
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
    font-size: 0.9rem;
}

.nav-link:hover {
    background-color: var(--light-gray);
    color: var(--secondary-blue);
}

#user-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#user-email {
    color: var(--dark-gray);
    font-weight: 500;
}

#article-content {
    white-space: pre-wrap;
}

.btn-logout {
    background-color: var(--accent-green);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background-color: #218838;
}

.tab-btn {
    background-color: var(--white);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    color: var(--dark-gray);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.tab-btn:hover, .tab-btn.active {
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.tab-content {
    display: none;
    background-color: var(--white);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 2rem;
}

.tab-content.active {
    display: block;
}

h2, h3 {
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
    font-weight: 700;
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 0.5rem;
}

#articles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.article-card {
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.article-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.article-card h3 {
    color: var(--dark-gray);
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.article-card p {
    color: #6c757d;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

button {
    background-color: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
}

button:hover {
    background-color: var(--secondary-blue);
}

.fab-btn {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 0;
    font-size: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
    z-index: 1000;
}

.fab-btn:hover {
    background-color: #0056d2;
}

/* Google Button Styles */
.btn-google {
    background-color: var(--white);
    color: var(--dark-gray);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
}

.btn-google:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.btn-google svg {
    width: 20px;
    height: 20px;
}

/* Button Styles */
.btn-primary {
    width: 100%;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: var(--dark-gray);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: #e5ebff;
}

.card-actions,
.detail-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.trending-section {
    margin-bottom: 1.5rem;
}

.trending-section h3 {
    margin-bottom: 0.75rem;
}

.auth-box .btn-primary,
.auth-box .btn-google {
    width: 100%;
}

/* Divider Styles */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #6c757d;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider:not(:empty)::before {
    margin-right: 0.5rem;
}

.divider:not(:empty)::after {
    margin-left: 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 16px var(--shadow);
}

.close {
    color: #6c757d;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: var(--dark-gray);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input, textarea {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Authentication Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 250px);
    padding: 2rem;
}

.auth-box {
    background-color: var(--white);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px var(--shadow);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--dark-gray);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--dark-gray);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    box-sizing: border-box;
}

.form-group.checkbox-group label {
    flex-direction: row;
    align-items: center;
    font-weight: 400;
}

.form-group.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.auth-link a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-link a:hover {
    color: var(--secondary-blue);
}

.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

/* Admin Dashboard Styles */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.admin-section {
    background-color: var(--white);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border);
}

.admin-section h3 {
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-blue);
}

.admin-article-item,
.character-item-admin {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: var(--light-gray);
}

.article-info,
.character-info {
    flex: 1;
    margin-right: 1rem;
}

.article-info h4,
.character-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--dark-gray);
}

.article-info p,
.character-info p {
    margin: 0.25rem 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.article-info small,
.character-info small {
    color: #6c757d;
    font-size: 0.8rem;
}

.article-actions,
.character-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-approve {
    background-color: var(--accent-green);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-approve:hover {
    background-color: #218838;
}

.btn-reject,
.btn-delete {
    background-color: #dc3545;
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-reject:hover,
.btn-delete:hover {
    background-color: #c82333;
}

.hamburger-menu {
    position: relative;
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.hamburger-btn:hover {
    background-color: var(--light-gray);
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background-color: var(--primary-blue);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.hamburger-nav {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 200px;
    background-color: var(--white);
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 8px var(--shadow);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    padding-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.hamburger-nav.active {
    transform: translateX(0);
}

.hamburger-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark-gray);
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
    line-height: 1.4;
    min-height: 40px;
}

.hamburger-item:last-child {
    border-bottom: none;
}

.hamburger-item:hover,
.hamburger-item.active {
    background-color: var(--light-gray);
    color: var(--primary-blue);
}

.hamburger-item.active {
    background-color: var(--primary-blue);
    color: var(--white);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.profile-info {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.profile-info p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-gray);
}

.form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.btn-secondary {
    background-color: var(--medium-gray);
    color: var(--dark-gray);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.btn-secondary:hover {
    background-color: #adb5bd;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--secondary-blue);
}

.articles-grid {
    display: grid;
    gap: 1rem;
}

.article-item {
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px var(--shadow);
}

.article-item h4 {
    margin: 0 0 0.5rem 0;
    color: var(--dark-gray);
}

.article-item p {
    margin: 0.25rem 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.status-published {
    color: var(--accent-green);
    font-weight: 500;
}

.status-pending {
    color: #ffc107;
    font-weight: 500;
}

.status-rejected {
    color: #dc3545;
    font-weight: 500;
}

.agreements-status {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.agreements-status p {
    margin: 0.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-agreed {
    background-color: #d4edda;
    color: #155724;
}

.status-not-agreed {
    background-color: #f8d7da;
    color: #721c24;
}

.danger-zone {
    margin-top: 3rem;
    padding: 2rem;
    border: 2px solid #dc3545;
    border-radius: 8px;
    background-color: #fff5f5;
}

.danger-zone h3 {
    color: #dc3545;
    margin-top: 0;
}

.danger-zone p {
    color: #721c24;
    margin-bottom: 1rem;
}

.btn-danger {
    background-color: #dc3545;
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.btn-danger:hover {
    background-color: #c82333;
}

footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--white);
    border-top: 1px solid var(--border);
    color: #6c757d;
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--secondary-blue);
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .tab-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    main {
        padding: 1rem;
    }

    #articles-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-content {
        margin: 10% auto;
        padding: 1rem;
        width: 95%;
    }

    /* Account page mobile styles */
    .hamburger-menu {
        margin-bottom: 1rem;
    }

    .hamburger-nav {
        min-width: 180px;
    }

    .hamburger-item {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gray);
}

/* Additional Styles for Clean Look */
.article-card {
    position: relative;
    overflow: hidden;
}

.article-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-green));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.article-card:hover::after {
    transform: scaleX(1);
}

.tab-content h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--primary-blue);
    margin-top: 0.5rem;
    border-radius: 2px;
}