/* Admin-specific styles */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    color: var(--clr-black);
    min-height: 100vh;
    background-color: #f8f9fa;
}

.admin-header {
    background: var(--clr-gradient-med);
    color: white;
    padding: 1rem 2rem;
    margin: -2rem -2rem 2rem -2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-nav {
    display: flex;
    gap: 1rem;
}

.admin-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.admin-nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.logout-form {
    margin: 0;
}

.logout-btn {
    background: var(--clr-logo-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.logout-btn:hover {
    background: #e8941f;
}

.admin-card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--clr-black);
}

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

.form-group textarea {
    min-height: 200px;
    resize: vertical;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    margin-right: 0.5rem;
}

.btn-primary {
    background: var(--clr-blue-light);
    color: white;
}

.btn-primary:hover {
    background: var(--clr-blue-medium);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

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

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

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

.post-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 1rem;
    align-items: center;
}

.post-image {
    width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.post-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--clr-black);
}

.post-meta {
    color: #666;
    font-size: 0.9rem;
}

.post-actions {
    display: flex;
    gap: 0.5rem;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.login-form {
    max-width: 400px;
    margin: 5rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.login-form h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--clr-black);
}

.editor-toolbar {
    border: 1px solid #ddd;
    border-bottom: none;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px 4px 0 0;
}

.editor-toolbar button {
    background: none;
    border: 1px solid #ddd;
    padding: 0.25rem 0.5rem;
    margin-right: 0.25rem;
    cursor: pointer;
    border-radius: 3px;
}

.editor-toolbar button:hover {
    background: #e9ecef;
}

.content-editor {
    border-radius: 0 0 4px 4px;
    border-top: none;
}

/* Publishing Options Styles */
.publish-options {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    background: #f8f9fa;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.radio-option:hover {
    border-color: var(--clr-blue-light);
    background: #f0f8ff;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-option input[type="radio"]:checked+.radio-custom {
    background: var(--clr-blue-light);
    border-color: var(--clr-blue-light);
}

.radio-option input[type="radio"]:checked+.radio-custom::after {
    opacity: 1;
    transform: scale(1);
}

.radio-option input[type="radio"]:checked~.radio-content strong {
    color: var(--clr-blue-light);
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: all 0.3s ease;
}

.radio-content {
    flex: 1;
}

.radio-content strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.radio-content small {
    color: #666;
    font-size: 0.875rem;
    line-height: 1.4;
}

.schedule-options {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.datetime-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.datetime-inputs .form-group {
    margin-bottom: 0;
}

.datetime-inputs input[type="date"],
.datetime-inputs input[type="time"] {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
}

.datetime-inputs input[type="date"]:focus,
.datetime-inputs input[type="time"]:focus {
    outline: none;
    border-color: var(--clr-blue-light);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.status-draft {
    background: #fff3cd;
    color: #856404;
}

.status-scheduled {
    background: #cce5ff;
    color: #004085;
}

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

@media (max-width: 768px) {
    .admin-container {
        padding: 1rem;
    }

    .admin-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .post-item {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .post-actions {
        justify-content: center;
    }

    .datetime-inputs {
        grid-template-columns: 1fr;
    }

    .radio-group {
        gap: 0.75rem;
    }

    .radio-option {
        padding: 0.75rem;
    }
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--clr-blue-light), var(--clr-blue-medium));
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.management-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2rem;
    margin-bottom: 2rem;
}

.management-section {
    min-height: 200px;
}

.management-section.scheduler-section {
    grid-column: 2;
    grid-row: 1 / 3;
    min-height: 420px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.section-header h2 {
    margin: 0;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-role {
    font-size: 0.9rem;
    color: #666;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

.post-item-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.post-image-small {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.post-info-compact {
    flex: 1;
}

.post-info-compact h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.post-meta-compact {
    font-size: 0.8rem;
    color: #666;
}

.post-actions-compact {
    display: flex;
    gap: 0.5rem;
}

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

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    text-align: right;
}

/* Change Password Modal enhancements */
.change-password-modal .modal-content {
    padding: 0;
    overflow: hidden;
}

.change-password-modal .modal-header {
    background: linear-gradient(135deg, var(--clr-blue-light), var(--clr-blue-medium));
    color: #fff;
}

.change-password-modal .modal-body {
    background: #fff;
}

.change-password-modal .modal-footer {
    background: #fafafa;
}

/* Form alert and field-level errors */
.form-alert {
    display: none;
    margin: 0 0 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    background: #f8d7da;
    color: #721c24;
    font-size: 0.95rem;
}

.input-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.field-error {
    display: none;
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

/* Scheduler Status Styles */
.scheduler-status {
    margin-bottom: 1rem;
}

.status-loading {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
    color: #666;
}

.status-info {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.status-running {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-stopped {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-details {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

.scheduler-controls {
    margin-top: 1rem;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

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

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
}

.logs-modal .modal-content {
    max-width: 800px;
}

.logs-content {
    background: #1e1e1e;
    color: #f8f8f2;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    padding: 1rem;
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Password field UI extras */
.pw-field {
    position: relative;
}

.pw-actions {
    position: absolute;
    top: 32px;
    right: 8px;
    display: flex;
    gap: 6px;
}

.pw-btn {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

.pw-btn:hover {
    background: #f3f3f3;
}

/* Icon-only password toggle button */
.pw-iconbtn {
    border: none;
    background: transparent;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    border-radius: 4px;
}

.pw-iconbtn:hover {
    background: #f3f3f3;
}

.pw-iconbtn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    color: #666;
}

/* Strength meter */
.strength-wrap {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 8px;
    border-radius: 4px;
    background: #eee;
    overflow: hidden;
}

.strength-bar>div {
    height: 100%;
    width: 0%;
    transition: width 200ms ease;
}

.strength-label {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: #666;
}

.strength-0 {
    background: #dc3545;
}

.strength-1 {
    background: #fd7e14;
}

.strength-2 {
    background: #ffc107;
}

.strength-3 {
    background: #17a2b8;
}

.strength-4 {
    background: #28a745;
}

@media (max-width: 768px) {
    .management-sections {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .section-actions {
        justify-content: center;
    }

    .post-item-compact {
        flex-direction: column;
        text-align: center;
    }

    .post-actions-compact {
        justify-content: center;
    }

    .scheduler-controls>div {
        justify-content: center;
    }
}