body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #111;
    color: #fff;
}

/* --- Shared Hero / Main Styles --- */
.hero {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8)), url('https://img.finalfantasyxiv.com/lds/h/a/tH677n02-w5r9d1r0s9.jpg');
    background-size: cover;
    background-position: center;
    height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    border-bottom: 4px solid #ff4757;
}

.hero h1 { font-size: 3.5rem; margin: 0 0 10px 0; text-transform: uppercase; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }
.hero p { font-size: 1.2rem; color: #ddd; margin-bottom: 30px; text-shadow: 0 1px 5px rgba(0,0,0,0.8); }

.search-bar-hero { position: relative; width: 500px; max-width: 90%; }
.search-bar-hero input { width: 100%; padding: 15px 25px; font-size: 1.1rem; border-radius: 30px; border: none; background: rgba(255,255,255,0.9); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.search-bar-hero input:focus { outline: none; background: #fff; }

.action-bar { display: flex; justify-content: flex-end; padding: 20px 40px; background: #1e1e1e; }
.btn-hero { background: #ff4757; color: white; border: none; padding: 10px 25px; font-size: 1rem; border-radius: 25px; cursor: pointer; font-weight: bold; text-transform: uppercase; transition: background 0.3s; }
.btn-hero:hover { background: #ff6b81; }

.container { padding: 40px; max-width: 1400px; margin: 0 auto; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 25px; }

/* Simple Card (Homepage) */
.card-simple { 
    background: #1e1e1e; 
    border-radius: 12px; 
    overflow: hidden; 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    position: relative; 
    border: 1px solid #333;
    cursor: pointer;
}
.card-simple:hover { 
    transform: translateY(-8px); 
    z-index: 10; 
    box-shadow: 0 15px 30px rgba(0,0,0,0.6); 
    border-color: #ff4757;
}
.card-img { width: 100%; height: 280px; object-fit: cover; object-position: center 15%; }
.card-overlay { 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 60%, transparent 100%); 
    padding: 40px 15px 15px 15px; 
    box-sizing: border-box; 
}
.card-name { font-size: 1.15rem; font-weight: bold; margin-bottom: 2px; color: #fff; letter-spacing: 0.5px; }
.card-server { font-size: 0.8rem; color: #aaa; text-transform: uppercase; letter-spacing: 1px; }

.card-ilvl { 
    position: absolute; 
    top: 12px; 
    right: 12px; 
    background: rgba(0,0,0,0.8); 
    padding: 4px 12px; 
    border-radius: 20px; 
    font-size: 0.85rem; 
    font-weight: 700; 
    color: #ff4757; 
    border: 1px solid rgba(255, 71, 87, 0.5); 
    backdrop-filter: blur(4px);
    z-index: 5;
}

.card-job-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,0.8);
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #444;
    z-index: 5;
}
.card-job-icon { width: 18px; height: 18px; }
.card-job-lvl { font-size: 0.75rem; font-weight: bold; color: #eee; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .fc-header-wrap { min-height: 350px !important; }
    .fc-name-large { font-size: 2.5rem !important; }
    .search-bar-hero { width: 100% !important; }
    .fc-stats-bar { gap: 20px; flex-wrap: wrap; }
    .fc-stat-pill { flex: 1 1 100px; }
    .container { padding: 20px; }
    .grid-cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
    .card-img { height: 200px; }
    .card-name { font-size: 1rem; }
    .card-job-badge { padding: 2px 5px; top: 8px; left: 8px; }
    .card-ilvl { padding: 2px 8px; top: 8px; right: 8px; font-size: 0.75rem; }
}

/* Modal & Form */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 2000; display: flex; justify-content: center; align-items: center; }
.hidden { display: none !important; }
.modal-content { background: #222; width: 500px; border-radius: 10px; border: 1px solid #444; color: #fff; position: relative; }
.modal-content h2 { margin: 0; padding: 20px; border-bottom: 1px solid #333; }
.close { position: absolute; right: 20px; top: 20px; cursor: pointer; color: #999; }
.tabs { display: flex; border-bottom: 1px solid #333; }
.tab-btn { flex: 1; padding: 15px; background: transparent; color: #777; border: none; cursor: pointer; font-weight: bold; }
.tab-btn.active { color: #ff4757; border-bottom: 2px solid #ff4757; }
.tab-pane { padding: 25px; display: none; }
.tab-pane.active { display: block; }
.form-group { margin-bottom: 20px; }
.modal-content input, .modal-content select { width: 100%; padding: 10px; background: #111; border: 1px solid #444; color: white; box-sizing: border-box; }
.btn-full { width: 100%; padding: 12px; background: #ff4757; color: white; border: none; font-weight: bold; cursor: pointer; }

/* --- Free Company Page (Refined) --- */

.fc-header-wrap, .profile-header-wrap {
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.9) 100%), url('https://img.finalfantasyxiv.com/lds/h/U/GF6l017wF-t268b3t58y8845_k.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    border-bottom: 1px solid #b09040;
    position: relative;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    min-height: 450px;
    overflow: visible !important; /* Fix for dropdown clipping */
}

.fc-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 10;
}

.fc-brand a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 1rem;
    transition: color 0.2s;
}
.fc-brand a:hover { color: #fff; }

.btn-update {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.3);
    color: #ddd;
    padding: 8px 20px;
    border-radius: 30px; /* Pill shape */
    cursor: pointer;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
}
.btn-update:hover { background: #b09040; color: #000; border-color: #b09040; }

.fc-hero-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.fc-server-large { 
    font-family: 'Cinzel', serif; /* Or fallback serif */
    font-size: 1.1rem; 
    color: #b09040; 
    text-transform: uppercase; 
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.fc-name-large { 
    font-size: 2.2rem; 
    font-weight: 400; 
    margin: 15px 0 25px 0; 
    color: #fff;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-family: 'Cinzel', serif; 
    text-shadow: 0 2px 10px rgba(0,0,0,1);
    
    /* Styled Underline */
    display: inline-block;
    border-bottom: 2px solid #b09040;
    padding-bottom: 5px;
}

.fc-tag-large { 
    font-size: 7rem; 
    font-weight: 900; 
    margin: 0; 
    letter-spacing: 5px;
    text-transform: uppercase;
    line-height: 1;
    
    /* Metallic Gold Gradient */
    background: linear-gradient(to bottom, #fff8db 0%, #e6bf56 40%, #b09040 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    
    /* Deep Shadow/Glow */
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.8)) drop-shadow(0 0 30px rgba(176, 144, 64, 0.4));
    
    font-family: 'Arial Black', 'Impact', sans-serif;
}

.fc-gc-large { 
    color: #aaa; 
    font-size: 0.9rem; 
    margin-top: 15px; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    opacity: 0.8;
}

/* Stats Bar embedded */
.fc-stats-bar {
    display: flex;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    gap: 60px;
    backdrop-filter: blur(10px);
}

.fc-stat-pill { text-align: center; }
.fc-stat-val { display: block; font-size: 1.6rem; font-weight: 300; color: #fff; }
.fc-stat-label { font-size: 0.7rem; color: #888; text-transform: uppercase; letter-spacing: 2px; margin-top: 5px; }

/* Main Grid Layout */
.fc-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .fc-grid { grid-template-columns: 1fr; }
}

/* Profile Specific Grid stretching */
.profile-grid {
    align-items: stretch;
}
.profile-grid aside, .profile-grid main {
    display: flex;
    flex-direction: column;
}
.profile-grid aside .fc-card, .profile-grid main .fc-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}
.profile-grid .fc-card-body {
    flex: 1;
}

/* Cards */
.fc-card {
    background: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    overflow: hidden;
    margin-bottom: 25px;
}

.fc-card-header {
    background: #252525;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    color: #b09040;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.fc-card-body { padding: 20px; }

/* Slogan */
.fc-slogan-text {
    font-size: 1.1rem;
    font-style: italic;
    color: #ddd;
    line-height: 1.6;
    text-align: center;
    padding: 10px;
    border-left: 3px solid #b09040;
    background: rgba(255,255,255,0.03);
}

/* Reputation List */
.fc-rep-row { display: flex; justify-content: space-between; margin-bottom: 12px; border-bottom: 1px dashed #333; padding-bottom: 5px; }
.fc-rep-row:last-child { margin-bottom: 0; border: none; }
.fc-rep-name { color: #ccc; }
.fc-rep-val { color: #ff4757; font-weight: bold; }

/* Estate */
.estate-title { color: #fff; font-weight: bold; font-size: 1.1rem; display: block; margin-bottom: 5px; }
.estate-addr { color: #999; font-size: 0.9rem; margin-bottom: 15px; display: block;}
.estate-quote { color: #aaa; font-style: italic; font-size: 0.9rem; background: #111; padding: 10px; border-radius: 4px; }

/* Member Grid */
.member-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.member-tile {
    background: #252525;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.member-tile:hover { transform: translateY(-3px); border-color: #b09040; background: #2a2a2a; }

.member-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; width: 4px;
    background: #333;
    transition: background 0.2s;
}
.member-tile:hover::before { background: #b09040; }

.member-tile img { width: 48px; height: 48px; border-radius: 5px; margin-right: 15px; border: 1px solid #444; }
.member-tile-info { flex-grow: 1; overflow: hidden; }
.member-tile-name { display: block; color: #fff; font-weight: bold; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-tile-meta { display: flex; justify-content: space-between; margin-top: 4px; font-size: 0.8rem; color: #888; }
.member-tile-ilvl { color: #ff4757; font-weight: bold; }

/* Loader */
#updateOverlay { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 9999; display: none; justify-content: center; align-items: center; flex-direction: column; color: white; }
.spinner { width: 40px; height: 40px; border: 4px solid #333; border-top: 4px solid #b09040; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 15px; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Job Selector Grid */
.job-grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 4px;
    margin-bottom: 15px;
}

.job-pill {
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 20px; /* Pill shape */
    text-align: center;
    padding: 2px 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.job-pill:hover { background: #3a3a3a; border-color: #555; }
.job-pill.active { background: #ff4757; border-color: #ff4757; color: white; box-shadow: 0 0 8px rgba(255, 71, 87, 0.3); }
.job-pill .code { font-weight: bold; font-size: 0.7rem; }
.job-pill .lvl { font-size: 0.65rem; color: #888; }
.job-pill.active .lvl { color: #ffd1d1; }
.job-pill.disabled { opacity: 0.2; cursor: default; }

/* Profile Page Specific Header Overrides */
.profile-header-wrap .fc-hero-content {
    padding: 60px 20px;
}

.profile-header-wrap .char-server-badge {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: #b09040;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.profile-header-wrap .char-name-hero {
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 5px 25px rgba(0,0,0,0.9);
    line-height: 1;
    letter-spacing: -2px;
    
    /* Underline style */
    display: inline-block;
    border-bottom: 3px solid #b09040;
    padding-bottom: 10px;
}