/* =============================================
   MEDIACENTRAL - SHARED CORE STYLES
   Everything in this file is used across all pages.
   ============================================= */

:root {
    --primary: #601b50;
    --primary-light: #af2e67;
    --secondary: #00aca2;
    --secondary-light: #c9dddb;
    --danger: #e94b54;
    --gray: #888;
    --light: #f8f9fa;
    --transition: all 0.3s ease;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.1);
    
    /* Шрифты из брендбука */
    --font-heading: 'Campton', sans-serif;
    --font-body: 'Minion Pro', serif;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes checkPop {
    0% { transform: scale(0) rotate(-180deg); }
    50% { transform: scale(1.3) rotate(0deg); }
    100% { transform: scale(1) rotate(0deg); }
}

body {
    background-color: var(--primary);
    background-image: linear-gradient(135deg, var(--primary) 0%, #4a143d 100%);
    min-height: 100vh;
    margin: 0;
    font-family: var(--font-body); /* Основной текст (Minion Pro) */
}

/* Заголовки и UI-элементы (Campton) */
h1, h2, h3, h4, h5, h6, 
.btn, .status-tab, .post-author, 
.platform-name, label, .text-counter {
    font-family: var(--font-heading);
}

.container { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }
.card { background: #fff; border-radius: 20px; padding: 30px; box-shadow: 0 15px 35px rgba(0,0,0,0.2); }

/* Button Core */
.btn {
    padding: 12px 24px; border: none; border-radius: 12px; cursor: pointer;
    font-weight: 600; text-transform: uppercase; transition: var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 10px;
    text-decoration: none; /* Prevents underline on anchor tags used as buttons */
}
.btn:hover { 
    transform: translateY(-3px); 
    box-shadow: var(--shadow-hover); 
    text-decoration: none; /* Keeps text clean on hover */
}

.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; }
.btn-teal { background: linear-gradient(135deg, var(--secondary) 0%, #00c4b8 100%); color: white; }
.btn-danger { background: linear-gradient(135deg, var(--danger) 0%, #d43940 100%); color: white; }
.btn-secondary { background: linear-gradient(135deg, #6c757d 0%, #828a91 100%); color: white; }
.btn-blue { background: linear-gradient(135deg, #007bff 0%, #3395ff 100%); color: white; }

.btn:disabled, .btn-publish-brand:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* ==========================================================================
   FORM INPUTS (TEXTAREA, SELECT, INPUT) FOR PUBLISH FORMS
   ========================================================================== */
.input-field {
    font-family: inherit; /* Принудительно наследуем красивый шрифт сайта */
    font-size: 14px;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    color: #444;
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field:focus {
    border-color: #1877F2; 
    outline: none;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.2);
}

select.input-field {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
     background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

textarea.input-field {
    line-height: 1.5;
    resize: vertical;
}

/* ==========================================================================
   GLOBAL UI COMPONENTS (TABS, POST CARDS, MEDIA, MODAL)
   ========================================================================== */

/* 1. Status Navigation Tabs (Admin, Mod, User) */
.status-nav {
    background: linear-gradient(135deg, rgba(96, 27, 80, 0.05) 0%, rgba(96, 27, 80, 0.08) 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid rgba(96, 27, 80, 0.1);
}
.status-tabs {
    display: flex; gap: 15px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px;
}
.status-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 5px; padding: 15px 10px; background: white; border: 1px solid #e9ecef;
    border-radius: 12px; color: var(--primary); text-decoration: none; font-weight: 600;
    font-size: 14px; transition: var(--transition); flex: 1; min-width: 120px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.status-tab:hover {
    transform: translateY(-3px); box-shadow: 0 8px 20px rgba(96, 27, 80, 0.15); text-decoration: none;
}
.status-tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: var(--primary); color: white; box-shadow: 0 8px 25px rgba(96, 27, 80, 0.4);
}
.status-tab i { font-size: 18px; margin-bottom: 2px; }

.tab-badge {
    background: rgba(0, 172, 162, 0.2); color: var(--secondary); font-size: 11px;
    font-weight: 800; width: 24px; height: 24px; line-height: 24px; text-align: center;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}
.status-tab.active .tab-badge { background: rgba(255, 255, 255, 0.2); color: #ffffff; }

/* 2. Global Post Cards */
.scheduled-post {
    background: #fff; border-radius: 16px; padding: 25px; margin-bottom: 25px;
    box-shadow: var(--shadow); border-left: 6px solid #e9ecef; position: relative;
}
.status-pending   { border-left-color: #ffc107 !important; }
.status-approved  { border-left-color: #28a745 !important; }
.status-rejected  { border-left-color: #dc3545 !important; }
.status-published { border-left-color: #007bff !important; }

/* 3. Media Grid & Placeholders */
.media-placeholder {
    position: relative; cursor: pointer; transition: var(--transition);
    border-radius: 8px; overflow: hidden; background: #000; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.media-placeholder:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.media-placeholder img, .media-placeholder video {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.media-play-overlay {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 40px; color: rgba(255, 255, 255, 0.9); pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); z-index: 2; transition: var(--transition);
}
.media-placeholder:hover .media-play-overlay { font-size: 48px; color: #fff; }

/* 4. Global Media Modal */
#media-modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.9);
    z-index: 99999; display: none; justify-content: center; align-items: center;
    padding: 20px; box-sizing: border-box; backdrop-filter: blur(8px);
}
#modal-img, #modal-video { max-width: 90vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); object-fit: contain; }
.modal-close-btn { position: absolute; top: 25px; right: 35px; color: white; font-size: 35px; cursor: pointer; z-index: 100000; }

.platform-card.selected {
    border-color: var(--secondary) !important;
    background: linear-gradient(135deg, rgba(0, 172, 162, 0.08) 0%, rgba(0, 172, 162, 0.15) 100%) !important;
    box-shadow: 0 8px 25px rgba(0, 172, 162, 0.3) !important;
}

/* =============================================
   TOTAL UNIFIED MEDIA COMPONENT
   ============================================= */
/* CONTAINER FOR EXACT FIT */
.media-thumb-wrapper {
    height: 200px;
    width: max-content;
    flex-shrink: 0;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    display: block;
    cursor: pointer;
}

/* IMAGE AND VIDEO SIZING WITHIN WRAPPER */
.media-thumb-wrapper img,
.media-thumb-wrapper video {
    height: 200px;
    width: auto;
    display: block;
}

/* OVERLAY AND PLAY ICON */
.media-thumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem; /* Reduced from 3rem to 2rem (approx 32px) */
    color: rgba(255, 255, 255, 0.7); /* Slightly transparent white */
    background: rgba(0, 0, 0, 0.15); /* Very light darkening */
    transition: all 0.2s ease;
}

.media-thumb-wrapper:hover .media-thumb-overlay {
    background: rgba(0, 0, 0, 0.3);
    color: #fff; /* Solid white on hover */
}

/* PADDING FOR INFO STACK TO AVOID STICKING TO BIG THUMBNAIL */
.media-info-stack {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* =============================================
   UNIFIED MEDIA ITEM CARD (Thumbnail + Info)
   ============================================= */
.media-item-container {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    gap: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    min-width: 220px;
    max-width: 100%;
}

.media-info-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-size: 14px;
    color: #444;
    flex-grow: 1;
}

.media-info-stack span {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.media-info-stack i {
    color: var(--secondary);
    width: 16px;
    text-align: center;
}