/* ========================================
   MODERN CARD-BASED THEME
   Perfect World Guild Management System
   ======================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #e5e5e5;
    line-height: 1.4;
    font-size: 16px;
}

/* Navigation Back Link */
.nav-back {
    color: rgba(251, 191, 36, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.3s ease;
}

.nav-back:hover {
    color: #fbbf24;
}

/* Navigation Title */
.nav-title {
    color: #e5e5e5;
    font-size: 20px;
    font-weight: 600;
    margin-left: auto;
}

/* Legacy Footer (Still Used in common-partials.html) */
.footer {
    text-align: center;
    padding: 24px 16px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    margin-top: 24px;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.25);
}

.footer p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
}

.footer-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(251, 191, 36, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fbbf24;
}

/* Login Layout (Still Used in Login Page) */
.login-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    min-height: calc(100vh - 60px);
}

.login-form,
.login-preview {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-input {
    accent-color: #fbbf24;
}

.checkbox-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}


.login-result {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    font-size: 16px;
}


.guild-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
}

/* Main Content Area */
.main-content {
    padding: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    align-items: end;
}

.form-submit {
    display: flex;
    align-items: flex-end;
}

.form-group {
    margin-bottom: 12px;
}

.form-label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: 500;
}


.icon-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 6px;
    margin-top: 8px;
    padding: 8px;
}

.icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.03);
    margin: 2px;
}

.icon-option:hover {
    border-color: rgba(251, 191, 36, 0.3);
    background-color: rgba(255, 255, 255, 0.05);
}

.icon-option:has(input[type="radio"]:checked) {
    border-color: rgba(251, 191, 36, 0.5);
    background-color: rgba(251, 191, 36, 0.1);
}

.icon-option input[type="radio"] {
    margin-bottom: 6px;
    accent-color: #fbbf24;
}

.icon-option input[type="radio"]:checked+img,
.icon-option input[type="radio"]:checked+span {
    filter: brightness(1.2);
}

.icon-option img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.icon-option span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    line-height: 1.3;
}

.item-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.multiselect-rooms {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
}

.multiselect-rooms:focus {
    outline: none;
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.multiselect-rooms option {
    padding: 8px;
    background: #1a1a2e;
    color: #ffffff;
    border-radius: 4px;
    margin: 2px 0;
}

.multiselect-rooms option:hover {
    background: rgba(251, 191, 36, 0.1);
}

.multiselect-rooms option:checked {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

/* Response Message Animations */
@keyframes response-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

@keyframes response-fade-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes response-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes response-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Response Message Container */
#response-message {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    min-width: 300px;
}

/* Response Message Base Styles */
.response-message {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: response-slide-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Success Message */
.response-success {
    background: #1a3d2e;
    border-color: #10b981;
    color: #10b981;
}

/* Error Message */
.response-error {
    background: #3d1a1a;
    border-color: #ef4444;
    color: #ef4444;
}

/* Info Message */
.response-info {
    background: #1a2a3d;
    border-color: #3b82f6;
    color: #3b82f6;
}

/* Warning Message */
.response-warning {
    background: #3d321a;
    border-color: #fbbf24;
    color: #fbbf24;
}

/* Auto-dismiss animation (applied via JS after delay) */
.response-message.dismissing {
    animation: response-slide-out 0.3s cubic-bezier(0.4, 0, 1, 1) both;
}

/* Hover to pause auto-dismiss */
.response-message:hover {
    animation-play-state: paused;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

/* Responsive Design for Modern Theme */
@media (max-width: 768px) {
    .modern-container {
        padding: 16px;
    }

    .modern-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .login-layout {
        grid-template-columns: 1fr;
    }

    .guild-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .icon-selector {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 8px;
    }

    .icon-option img {
        width: 32px;
        height: 32px;
    }

    .item-icon {
        width: 20px;
        height: 20px;
    }

    #response-message {
        top: 60px;
        right: 10px;
        max-width: calc(100vw - 20px);
        min-width: 250px;
    }

    .modern-nav {
        padding: 12px 16px;
    }

    .nav-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .modern-container {
        padding: 12px;
    }

    .glass-card {
        padding: 12px;
        border-radius: 16px;
    }

    .modern-title {
        font-size: 18px;
    }

    .modern-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .modern-input {
        padding: 10px 14px;
        font-size: 14px;
    }

    .icon-selector {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }

    .icon-option img {
        width: 36px;
        height: 36px;
    }

    #response-message {
        top: 50px;
        right: 5px;
        max-width: calc(100vw - 10px);
        min-width: 200px;
    }

    .response-message {
        padding: 10px 12px;
        font-size: 12px;
    }

    .nav-title {
        font-size: 16px;
    }
}

/* ========================================
   MODERN CARD-BASED THEME
   Apple / Notion / Discord Style
   ======================================== */

/* Modern Background with Gradient */
.modern-bg {
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
}

/* Modern Container */
.modern-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Glass Card with Glassmorphism */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow:
        0 8px 32px 0 rgba(0, 0, 0, 0.37),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 12px 48px 0 rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    border-color: rgba(251, 191, 36, 0.3);
}

/* Modern Card Header */
.modern-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modern-icon {
    font-size: 24px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modern-title {
    font-size: 20px;
    font-weight: 600;
    background: linear-gradient(135deg, #ffffff 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Modern Grid */
.modern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* Modern Stats Box */
.modern-stat {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(0, 0, 0, 0.2) 100%);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    box-shadow:
        0 4px 16px 0 rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(251, 191, 36, 0.1) inset;
    transition: all 0.3s ease;
}

.modern-stat:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px 0 rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(251, 191, 36, 0.2) inset;
}

.modern-stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    font-weight: 500;
}

.modern-stat-value {
    font-size: 28px;
    font-weight: 600;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Modern Navigation */
.modern-nav {
    display: flex;
    align-items: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 24px;
    margin-bottom: 12px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.3);
}

/* Modern Button */
.modern-btn {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.2) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    color: #fbbf24;
    padding: 12px 24px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modern-btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4);
}

.modern-btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 10px;
}

.modern-btn-danger {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);
    color: #ef4444;
}

.modern-btn-danger:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.modern-btn-success {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
    color: #10b981;
}

.modern-btn-success:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

/* Modern Sidebar */
.modern-sidebar {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.modern-sidebar-item {
    display: block;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.modern-sidebar-item:hover,
.modern-sidebar-item.active {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.15) 100%);
    color: #fbbf24;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.2);
}

/* Modern Text Effects */
.modern-text-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

/* Modern Divider */
.modern-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(251, 191, 36, 0.3) 50%, transparent 100%);
    margin: 24px 0;
}

/* Modern Member Card */
.modern-member-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.25);
}

.modern-member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.35);
    border-color: rgba(251, 191, 36, 0.3);
}

/* Compact TS3 Client Card */
.ts3-client-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px 10px;
    margin-bottom: 4px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
}

.ts3-client-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.3);
    border-color: rgba(251, 191, 36, 0.2);
}

.ts3-btn {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 8px;
    min-width: 32px;
}

/* Modern Input */
.modern-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #ffffff;
    transition: all 0.3s ease;
    width: 100%;
}

.modern-input:focus {
    outline: none;
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

.modern-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

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

/* Modern Select Dropdown */
.modern-input select,
select.modern-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23fbbf24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.modern-input select option,
select.modern-input option {
    background: #1a1a2e;
    color: #ffffff;
    padding: 12px;
}

/* Modern Form Grid Enhancement */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    align-items: end;
}

/* Modern Code Block */
pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* CSS-only Toggle for Forms (Add Member, Add Item, etc.) */
.hidden-checkbox {
    display: none;
}

.add-member-toggle-area {
    margin-bottom: 12px;
}

.add-member-form-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0;
}

.hidden-checkbox:checked+.add-member-toggle-area+.add-member-form-content {
    max-height: 2000px;
    opacity: 1;
    margin-bottom: 12px;
}

.hidden-checkbox:checked+.add-member-toggle-area {
    display: none;
}