/* XooPress Core Stylesheet */

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

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
    background: #f5f5f5;
    min-height: 100vh;
}

a {
    color: #0073aa;
    text-decoration: none;
}

a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header (module pages) */
.header {
    background: #23282d;
    color: #fff;
    padding: 20px 0;
    text-align: center;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.header .version {
    color: #999;
    font-size: 0.9rem;
}

/* Site Header (theme) */
.site-header {
    background: #23282d;
    color: #fff;
    padding: 15px 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.site-branding h1 {
    font-size: 1.5rem;
    margin: 0;
}

.site-branding h1 a {
    color: #fff;
    text-decoration: none;
}

.site-branding h1 a:hover {
    color: #00a0d2;
}

.site-description {
    font-size: 0.85rem;
    color: #b4b9be;
    margin-top: 2px;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    margin: 0;
}

.main-navigation a {
    display: block;
    padding: 8px 14px;
    color: #b4b9be;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.main-navigation a:hover {
    color: #fff;
}

.language-switcher select {
    padding: 4px 8px;
    border: 1px solid #555;
    border-radius: 3px;
    background: #32373c;
    color: #b4b9be;
    font-size: 0.85rem;
    cursor: pointer;
}

/* Site Content (theme) */
.site-content {
    padding: 30px 0;
    min-height: 60vh;
}

/* Content Area */
.content-area {
    max-width: 800px;
    margin: 0 auto;
}

.content-area h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #23282d;
}

/* Post Cards */
.post-card {
    background: #fff;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.entry-title {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.entry-title a {
    color: #23282d;
    text-decoration: none;
}

.entry-title a:hover {
    color: #0073aa;
}

.entry-meta {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 12px;
}

.entry-summary p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Post Full */
.post-full {
    background: #fff;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.post-full .entry-title {
    font-size: 2rem;
    margin-bottom: 10px;
}

.entry-content {
    line-height: 1.8;
    color: #333;
}

.entry-content p {
    margin-bottom: 15px;
}

/* Site Footer (theme) */
.site-footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 0.9rem;
    border-top: 1px solid #e0e0e0;
    margin-top: 40px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    margin: 20px 0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #23282d;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: #0073aa;
    color: #fff;
}

.btn-primary:hover {
    background: #005a87;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #dc3232;
    color: #fff;
}

.btn-danger:hover {
    background: #b52626;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Actions */
.actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.feature-card {
    background: #fff;
    padding: 25px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.feature-card h3 {
    margin-bottom: 10px;
    color: #23282d;
}

.feature-card p {
    color: #666;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 0.9rem;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f1f1f1;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 5px;
    color: #23282d;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
    font-weight: normal;
    font-size: 1.1rem;
}

.login-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Alerts */
.alert {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.alert-error {
    background: #fbeaea;
    color: #dc3232;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #ecf7ed;
    color: #46b450;
    border: 1px solid #c3e6cb;
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Hamburger toggle for mobile sidebar */
.admin-sidebar-toggle {
    display: none;
    background: #23282d;
    color: #fff;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    text-align: left;
    align-items: center;
    gap: 10px;
}

.admin-sidebar-toggle:hover {
    background: #32373c;
}

.admin-sidebar-toggle .toggle-icon {
    display: inline-block;
    width: 22px;
    text-align: center;
}

.admin-sidebar {
    width: 250px;
    background: #23282d;
    color: #fff;
    padding: 20px 0;
    flex-shrink: 0;
}

.admin-sidebar h2 {
    padding: 0 20px;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.admin-nav {
    list-style: none;
}

.admin-nav li {
    margin: 0;
}

.admin-nav a {
    display: block;
    padding: 10px 20px;
    color: #b4b9be;
    text-decoration: none;
    transition: all 0.2s;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: #32373c;
    color: #fff;
}

.admin-content {
    flex: 1;
    padding: 20px;
    background: #f1f1f1;
    min-width: 0; /* prevent flex overflow */
}

.admin-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-header h1 {
    font-size: 1.5rem;
    color: #23282d;
}

/* Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #23282d;
}

/* Tables */
.admin-table-container {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.admin-table th {
    background: #f8f8f8;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.admin-table tr:hover {
    background: #f8f8f8;
}

.text-center {
    text-align: center;
}

/* Form Container */
.admin-form-container {
    background: #fff;
    padding: 25px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 600px;
}

/* Admin Notices */
.admin-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: admin-notice-slide 0.3s ease-out;
}

@keyframes admin-notice-slide {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-notice-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.admin-notice-text {
    flex: 1;
}

.admin-notice-dismiss {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s;
    color: inherit;
}

.admin-notice-dismiss:hover {
    opacity: 1;
}

.admin-notice-success {
    background: #ecf7ed;
    color: #2c7a3a;
    border: 1px solid #c3e6cb;
}

.admin-notice-error {
    background: #fbeaea;
    color: #b52626;
    border: 1px solid #f5c6cb;
}

.admin-notice-warning {
    background: #fef7ed;
    color: #b8860b;
    border: 1px solid #fae4b3;
}

.admin-notice-info {
    background: #e8f4fd;
    color: #005a87;
    border: 1px solid #b8d4e8;
}

/* Pagination */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    gap: 15px;
    flex-wrap: wrap;
}

.admin-pagination-info {
    font-size: 0.85rem;
    color: #666;
}

.admin-pagination-links {
    display: flex;
    gap: 4px;
    align-items: center;
}

.admin-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    color: #333;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.15s;
}

.admin-pagination-link:hover {
    background: #f0f0f0;
    border-color: #ccc;
    text-decoration: none;
}

.admin-pagination-link.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.admin-pagination-ellipsis {
    padding: 0 4px;
    color: #999;
    font-size: 0.85rem;
}

/* Bulk Actions */
.admin-bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
}

.admin-bulk-actions select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.85rem;
    background: #fff;
}

.admin-bulk-actions .btn {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.admin-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Search & Filter Bar */
.admin-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-search-bar input[type="search"],
.admin-search-bar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.9rem;
    background: #fff;
}

.admin-search-bar input[type="search"] {
    min-width: 200px;
    flex: 1;
}

.admin-search-bar input[type="search"]:focus,
.admin-search-bar select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Password Field Toggle */
.password-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field-wrapper input {
    padding-right: 40px !important;
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    transition: color 0.15s;
    line-height: 0;
}

.password-toggle-btn:hover {
    color: #333;
}

.password-toggle-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle-btn .eye-open {
    display: none;
}

.password-toggle-btn .eye-closed {
    display: block;
}

.password-toggle-btn.password-visible .eye-open {
    display: block;
}

.password-toggle-btn.password-visible .eye-closed {
    display: none;
}

/* ============================================
   RESPONSIVE - Mobile-first responsive styles
   ============================================ */

/* Sidebar overlay (for mobile) */
.admin-sidebar-overlay {
    display: none;
}

/* Medium devices (tablets, 576px to 991px) — slide-in sidebar from left */
@media (min-width: 576px) and (max-width: 991.98px) {
    html {
        font-size: 15.5px;
    }

    /* Hamburger toggle always visible on tablets */
    .admin-sidebar-toggle {
        display: flex;
    }

    /* Sidebar becomes a fixed overlay panel from the left */
    .admin-layout {
        flex-direction: row;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        display: block;
        padding: 20px 0;
        z-index: 99;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .admin-sidebar.open {
        left: 0;
    }

    .admin-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 98;
    }

    .admin-sidebar-overlay.open {
        display: block;
    }

    .admin-content {
        padding: 18px;
        margin-left: 0;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-header {
        flex-direction: row;
        align-items: center;
    }

    .admin-search-bar input[type="search"] {
        min-width: 150px;
    }

    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    [style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* Small devices (phones, less than 576px) — slide-in sidebar from left */
@media (max-width: 575.98px) {
    html {
        font-size: 15px;
    }

    .admin-sidebar-toggle {
        display: flex;
    }

    .admin-layout {
        flex-direction: column;
        position: relative;
    }

    .admin-sidebar {
        width: 260px;
        display: block;
        padding: 20px 0;
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh;
        z-index: 99;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .admin-sidebar.open {
        left: 0;
    }

    .admin-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 98;
    }

    .admin-sidebar-overlay.open {
        display: block;
    }

    .admin-content {
        padding: 15px;
    }

    .admin-header h1 {
        font-size: 1.2rem;
    }

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

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-card {
        padding: 15px;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .admin-table th {
        font-size: 0.78rem;
    }

    .admin-form-container {
        padding: 15px;
        max-width: 100%;
    }

    .admin-search-bar input[type="search"] {
        min-width: 100%;
    }

    .admin-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-search-bar select {
        width: 100%;
    }

    .admin-pagination {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .admin-bulk-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .admin-bulk-actions select {
        flex: 1;
        min-width: 120px;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero {
        padding: 30px 15px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-header a.btn,
    .admin-header div {
        width: 100%;
    }

    .admin-header a.btn {
        text-align: center;
    }

    /* Card-based table on very small screens */
    .admin-table {
        font-size: 0.85rem;
    }

    .admin-nav a {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    /* Theme cards */
    .theme-grid {
        grid-template-columns: 1fr !important;
    }

    .theme-card-body {
        padding: 12px;
    }

    .theme-screenshot {
        height: 120px;
    }

    .theme-actions {
        flex-direction: column;
    }

    .theme-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Settings form */
    .admin-form-container form .btn {
        width: 100%;
        text-align: center;
    }

    /* Post editor */
    .editor-tabs {
        flex-wrap: wrap;
    }

    .editor-tab {
        flex: 1;
        min-width: 60px;
        text-align: center;
        font-size: 0.8rem;
        padding: 8px 10px;
    }

    .editor-toolbar {
        padding: 6px 8px;
    }

    .editor-toolbar button {
        padding: 4px 8px;
        font-size: 0.78rem;
    }

    .editor-panel textarea,
    .editor-panel .wysiwyg-editor {
        min-height: 250px;
        padding: 10px;
        font-size: 0.85rem;
    }

    .preview-toggle button {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    [style*="display:grid"] {
        grid-template-columns: 1fr !important;
    }

    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    [style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Table container on mobile doesn't need overflow if we do stacked */
    .admin-table-container {
        overflow-x: auto;
    }
}

/* Large screens (992px+) — sidebar always visible on left */
@media (min-width: 992px) {
    .admin-sidebar-toggle {
        display: none;
    }

    .admin-sidebar-overlay {
        display: none !important;
    }
}

/* =============================================
   Password Strength Meter & Requirements
   ============================================= */
.password-strength-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.password-strength-track {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-bar.strength-red {
    background-color: #e74c3c;
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.4);
}

.password-strength-bar.strength-orange {
    background-color: #e67e22;
    box-shadow: 0 0 6px rgba(230, 126, 34, 0.4);
}

.password-strength-bar.strength-yellow {
    background-color: #f1c40f;
    box-shadow: 0 0 6px rgba(241, 196, 15, 0.4);
}

.password-strength-bar.strength-green {
    background-color: #27ae60;
    box-shadow: 0 0 6px rgba(39, 174, 96, 0.4);
}

.password-strength-label {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 55px;
    text-align: right;
    color: #555;
}

.password-requirements {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    font-size: 0.82rem;
}

.password-requirements li {
    padding: 2px 0;
    color: #666;
}

.password-requirements .req-met {
    color: #27ae60;
    font-weight: bold;
    margin-right: 4px;
}

.password-requirements .req-unmet {
    color: #e74c3c;
    font-weight: bold;
    margin-right: 4px;
}
