@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@400;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --xf-pageBg: #0f172a;
    --xf-contentBg: #1e293b;
    --xf-textColor: #e2e8f0;
    --xf-textColorMuted: #94a3b8;
    --xf-linkColor: #38bdf8;
    --xf-linkColorHover: #fbbf24;
    --xf-borderColor: #334155;
    --xf-blockHeaderBg: linear-gradient(135deg, #1e293b, #0f172a);
    --xf-blockHeaderTextColor: #ffffff;
    --xf-nodeBg: #1e293b;
    --xf-nodeIcon: #fbbf24;
    --xf-rowBgAlt: #0f172a;
    --xf-buttonBg: #2563eb;
    --xf-buttonTextColor: #ffffff;
}

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

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', sans-serif;
    background-color: var(--xf-pageBg);
    color: var(--xf-textColor);
    font-size: 16px;
    line-height: 1.6;
    background-image: radial-gradient(circle at 50% 0%, #0f172a 0%, transparent 50%);
    background-attachment: fixed;
    letter-spacing: 0.3px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(56, 189, 248, 0); }
    100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

a {
    color: var(--xf-linkColor);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--xf-linkColorHover);
    text-shadow: 0 0 5px rgba(125, 211, 252, 0.5);
}

.p-pageWrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.p-nav {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    color: #f2f2f2;
    border-bottom: 1px solid var(--xf-borderColor);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.p-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.p-nav-logo {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
.p-nav-logo i { color: #fbbf24; }
.p-nav-logo:hover { text-decoration: none; color: #fff; }

.site-logo {
    height: 160px;
    margin: -45px 0;
    max-width: 300px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
    transition: transform 0.3s ease;
}
.site-logo:hover {
    transform: scale(1.05);
}

.p-nav-list {
    display: flex;
    gap: 15px;
    align-items: center;
}

.p-nav-link {
    color: #e2e8f0;
    font-weight: 600;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 15px;
}
.p-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fbbf24;
    text-decoration: none;
}

.p-body {
    flex-grow: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease-out;
}

.p-title {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.p-title-actions {
    float: right;
    margin-top: 10px;
}

/* XenForo Blocks */
.block {
    margin-bottom: 35px;
    background: var(--xf-contentBg);
    border: 1px solid var(--xf-borderColor);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: fadeIn 0.6s ease-out backwards;
}

.block:nth-child(2) { animation-delay: 0.1s; }
.block:nth-child(3) { animation-delay: 0.2s; }

.block-header {
    background: var(--xf-blockHeaderBg);
    color: var(--xf-blockHeaderTextColor);
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid rgba(0,0,0,0.2);
}
.block-header a {
    color: var(--xf-blockHeaderTextColor);
}

.block-body {
    display: flex;
    flex-direction: column;
}

/* Node List (Categories) */
.node {
    display: flex;
    padding: 22px 24px;
    border-bottom: 1px solid var(--xf-borderColor);
    background: var(--xf-nodeBg);
    transition: all 0.3s;
    align-items: center;
}
.node:last-child {
    border-bottom: none;
}
.node:hover {
    background: var(--xf-rowBgAlt);
    transform: translateX(5px);
}

.node-icon {
    width: 55px;
    font-size: 38px;
    color: var(--xf-nodeIcon);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 20px;
    transition: transform 0.3s;
}
.node:hover .node-icon {
    transform: scale(1.1);
    color: var(--xf-linkColorHover);
}

.node-main {
    flex-grow: 1;
}

.node-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px 0;
}

.node-description {
    font-size: 14px;
    color: var(--xf-textColorMuted);
    line-height: 1.5;
}

.node-stats {
    width: 160px;
    font-size: 14px;
    color: var(--xf-textColorMuted);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

/* StructItem (Thread List) */
.structItem {
    display: flex;
    padding: 18px 24px;
    border-bottom: 1px solid var(--xf-borderColor);
    background: var(--xf-contentBg);
    transition: all 0.2s;
    align-items: center;
}
.structItem:last-child {
    border-bottom: none;
}
.structItem:hover {
    background: var(--xf-rowBgAlt);
}

.structItem-iconContainer {
    width: 50px;
    margin-right: 20px;
    display: flex;
    align-items: center;
}
.avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
    position: relative;
}
.avatar::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background-color: #10b981;
    border: 2px solid var(--xf-contentBg);
    border-radius: 50%;
}

.structItem-main {
    flex-grow: 1;
}

.structItem-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.4;
}

.structItem-minor {
    font-size: 14px;
    color: var(--xf-textColorMuted);
}

.structItem-meta {
    width: 160px;
    font-size: 14px;
    color: var(--xf-textColorMuted);
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

/* Messages (Thread View) */
.message {
    background: var(--xf-contentBg);
    border: 1px solid var(--xf-borderColor);
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: fadeIn 0.5s ease-out backwards;
}

.message-cell--user {
    width: 200px;
    background: var(--xf-rowBgAlt);
    border-right: 1px solid var(--xf-borderColor);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.message-avatar {
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.35);
    position: relative;
}
.message-avatar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background-color: #10b981;
    border: 3px solid var(--xf-rowBgAlt);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.message-name {
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    word-wrap: break-word;
    color: var(--xf-linkColor);
}
.message-userTitle {
    font-size: 13px;
    color: var(--xf-textColorMuted);
    text-align: center;
    margin-top: 8px;
    background: rgba(255,255,255,0.05);
    padding: 4px 12px;
    border-radius: 12px;
}

.message-cell--main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.message-header {
    padding: 16px 25px;
    border-bottom: 1px solid var(--xf-borderColor);
    font-size: 14px;
    color: var(--xf-textColorMuted);
    display: flex;
    justify-content: space-between;
    background: rgba(0,0,0,0.1);
}

.message-content {
    padding: 30px 25px;
    flex-grow: 1;
    font-size: 16px;
    line-height: 1.8;
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}
.button:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    text-decoration: none;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.5);
}
.button--cta {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 2px 5px rgba(220, 38, 38, 0.3);
}
.button--cta:hover {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.5);
}

/* Forms */
.input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--xf-borderColor);
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
    color: var(--xf-textColor);
    font-family: inherit;
    font-size: 15px;
    transition: all 0.3s;
}
.input:focus {
    border-color: var(--xf-linkColor);
    outline: none;
    background: rgba(0,0,0,0.4);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.formRow {
    margin-bottom: 20px;
}
.formRow-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--xf-textColor);
}

/* Footer */
.p-footer {
    background: rgba(15, 23, 42, 0.95);
    color: #94a3b8;
    padding: 35px 0;
    text-align: center;
    font-size: 14px;
    border-top: 1px solid var(--xf-borderColor);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .p-nav-inner {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 25px;
    }
    
    .site-logo {
        height: 120px;
        margin: -20px 0 -10px 0;
    }
    
    .p-nav-list {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 10px;
    }

    .p-body {
        padding: 15px 10px;
    }

    .p-title-actions {
        float: none;
        margin-top: 0;
        margin-bottom: 15px;
        width: 100%;
    }
    .p-title-actions .button {
        width: 100%;
        justify-content: center;
    }
    
    .p-title {
        font-size: 22px;
        text-align: center;
    }

    /* Fix Node Wrapping */
    .node {
        flex-wrap: wrap;
        padding: 15px;
    }
    .node-icon {
        width: 45px;
        margin-right: 15px;
    }
    .node-main {
        width: calc(100% - 60px);
    }
    .node-stats {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 20px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px dashed rgba(255,255,255,0.1);
    }
    .node-stats dl {
        display: flex;
        gap: 5px;
    }
    .node-stats dt { color: var(--xf-textColorMuted); }
    .node-stats dd { color: #fff; font-weight: 600; }
    
    /* Fix StructItem Wrapping */
    .structItem {
        flex-wrap: wrap;
        padding: 15px;
    }
    .structItem-iconContainer {
        width: 40px;
        margin-right: 15px;
    }
    .structItem-main {
        width: calc(100% - 55px);
    }
    .structItem-meta {
        width: 100%;
        text-align: left;
        flex-direction: row;
        justify-content: flex-start;
        gap: 15px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px dashed rgba(255,255,255,0.1);
    }
    .structItem-meta dl {
        display: flex;
        gap: 5px;
    }
    .structItem-meta dt { color: var(--xf-textColorMuted); }
    .structItem-meta dd { color: #fff; font-weight: 600; }

    /* Fix Messages Wrapping */
    .message {
        flex-direction: column;
    }
    .message-cell--user {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--xf-borderColor);
        padding: 10px 15px;
        align-items: center;
        gap: 15px;
    }
    .message-avatar {
        width: 48px;
        height: 48px;
        font-size: 20px;
        margin-bottom: 0;
    }
    .message-avatar::after {
        width: 12px;
        height: 12px;
        border-width: 2px;
    }
    .message-userDetails {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    .message-name {
        text-align: left;
        font-size: 16px;
    }
    .message-userTitle {
        margin-top: 2px;
    }
    
    /* Global Adjustments */
    .block-header {
        font-size: 15px;
        padding: 10px 15px;
    }
    .message-content {
        padding: 15px;
    }
}

