/* ============================================
   Admin Common Styles
   Shared styles for admin pages
   ============================================ */

/* ============================================
   Dark Mode Input Fixes
   Ensures high contrast for all input types
   ============================================ */

/* Base input styles */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
textarea,
select {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    caret-color: var(--gold-primary, #d4af37);
}

/* Focus states */
input:focus,
textarea:focus,
select:focus {
    background-color: #333333 !important;
    color: #ffffff !important;
    border-color: var(--gold-primary, #d4af37) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15) !important;
}

/* Placeholder text */
input::placeholder,
textarea::placeholder {
    color: #888888 !important;
    opacity: 1 !important;
}

/* Autofill fix for Chrome/Edge */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #2d2d2d inset !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
}

/* Date/time input icons */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8) sepia(1) saturate(5) hue-rotate(10deg);
    cursor: pointer;
}

/* Select dropdown arrow */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4af37' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px !important;
}

/* Select option styling */
select option {
    background-color: #2d2d2d;
    color: #ffffff;
    padding: 10px;
}

select optgroup {
    background-color: #1a1a1a;
    color: var(--gold-primary, #d4af37);
    font-weight: bold;
}

/* Checkbox and Radio */
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--gold-primary, #d4af37);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Range slider */
input[type="range"] {
    accent-color: var(--gold-primary, #d4af37);
}

/* File input */
input[type="file"] {
    color: #ffffff;
}

input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, #d4af37 0%, #f3e5ab 50%, #b88a18 100%);
    color: #000000;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 10px;
    transition: transform 0.2s;
}

input[type="file"]::file-selector-button:hover {
    transform: scale(1.02);
}

/* ============================================
   Form Control Classes
   ============================================ */

.form-control {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control-sm {
    padding: 8px 12px;
    font-size: 0.9em;
}

.form-control-lg {
    padding: 15px 18px;
    font-size: 1.1em;
}

.form-label {
    display: block;
    color: #cccccc;
    font-size: 0.9em;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-hint {
    font-size: 0.8em;
    color: #888888;
    margin-top: 4px;
}

.form-error {
    font-size: 0.85em;
    color: #dc3545;
    margin-top: 4px;
}

/* ============================================
   Draft Indicator Styles
   ============================================ */

.draft-indicator {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(30, 30, 30, 0.9) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.draft-indicator-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.draft-icon {
    font-size: 1.5em;
}

.draft-text {
    flex: 1;
    color: #cccccc;
}

.draft-saved-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #28a745;
    font-size: 0.85em;
    margin-left: 15px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.draft-saved-indicator.flash {
    opacity: 1;
    animation: flashGreen 0.5s ease;
}

@keyframes flashGreen {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; color: #5cb85c; }
}

/* ============================================
   Comment Styles
   ============================================ */

.comments-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.comments-header h3 {
    color: var(--gold-primary, #d4af37);
    font-family: 'Playfair Display', serif;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comments-count {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-primary, #d4af37);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.85em;
}

/* Comment Form */
.comment-form {
    margin-bottom: 25px;
}

.comment-form textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

/* Comment List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comments-loading,
.comments-empty,
.comments-error {
    text-align: center;
    padding: 40px 20px;
    color: #888888;
}

.comments-empty .empty-icon {
    font-size: 2.5em;
    display: block;
    margin-bottom: 10px;
}

.empty-hint {
    font-size: 0.9em;
    color: #666666;
    margin-top: 5px;
}

/* Individual Comment */
.comment {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.2s;
}

.comment:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Nested comments */
.comment-nested {
    margin-left: calc(var(--depth, 0) * 20px);
    background: rgba(255, 255, 255, 0.01);
    border-left: 2px solid rgba(212, 175, 55, 0.2);
}

/* Admin comment styling */
.comment-admin {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(30, 30, 30, 0.8) 100%);
    border-color: rgba(212, 175, 55, 0.3);
}

.comment-admin:hover {
    border-color: rgba(212, 175, 55, 0.5);
}

.comment-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #888888;
    font-size: 1.1em;
}

.comment-admin .comment-avatar {
    background: var(--gold-gradient, linear-gradient(135deg, #d4af37 0%, #f3e5ab 50%, #b88a18 100%));
    color: #000000;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    color: #e0e0e0;
}

.author-admin {
    color: var(--gold-primary, #d4af37);
}

.admin-badge {
    background: var(--gold-gradient, linear-gradient(135deg, #d4af37 0%, #f3e5ab 50%, #b88a18 100%));
    color: #000000;
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.comment-date {
    font-size: 0.8em;
    color: #666666;
}

.comment-content {
    color: #cccccc;
    line-height: 1.6;
    word-wrap: break-word;
}

.comment-content a {
    color: var(--gold-primary, #d4af37);
}

.comment-content .mention {
    color: var(--gold-primary, #d4af37);
    background: rgba(212, 175, 55, 0.1);
    padding: 1px 4px;
    border-radius: 4px;
}

.comment-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.action-btn {
    background: none;
    border: none;
    color: #666666;
    font-size: 0.85em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    transition: color 0.2s;
}

.action-btn:hover {
    color: var(--gold-primary, #d4af37);
}

.action-btn .action-icon {
    font-size: 0.9em;
}

/* Reply form */
.reply-form-container {
    margin-top: 12px;
}

.reply-form {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.reply-input {
    width: 100%;
    min-height: 60px;
    resize: vertical;
}

.reply-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: flex-end;
}

/* Replies container */
.comment-replies {
    margin-top: 15px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.replies-collapsed {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.replies-count {
    color: #888888;
    font-size: 0.9em;
}

.show-more-replies {
    background: none;
    border: none;
    color: var(--gold-primary, #d4af37);
    font-size: 0.9em;
    cursor: pointer;
    padding: 5px 0;
    transition: opacity 0.2s;
}

.show-more-replies:hover {
    opacity: 0.8;
}

/* ============================================
   Toast Notifications
   ============================================ */

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #1a1a1a;
    border-radius: 8px;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    max-width: 350px;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-info {
    border-left: 4px solid var(--gold-primary, #d4af37);
}

.toast-icon {
    font-size: 1.2em;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.95em;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    .comment {
        padding: 12px;
    }

    .comment-nested {
        margin-left: calc(var(--depth, 0) * 12px);
    }

    .comment-avatar {
        width: 35px;
        height: 35px;
        min-width: 35px;
        font-size: 1em;
    }

    .comment-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    #toast-container {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
    }

    .toast {
        max-width: none;
    }
}
