/* Complete Storage Manager Pro - Admin Styles */

/* ==================== 1. STORAGE NOTICES & WIDGETS ==================== */

/* Storage Notices */
.csm-storage-notice {
    background: #fff;
    border-left: 4px solid #46b450;
    padding: 15px;
    margin: 15px 0;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.csm-media-notice {
    background: #f0f8ff;
    border-left: 4px solid #2196F3;
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.csm-status-critical {
    color: #dc3232;
    font-weight: bold;
}

.csm-status-warning {
    color: #ffb900;
    font-weight: bold;
}

.csm-pricing-link {
    margin: 10px 0 0 0;
}

.csm-pricing-link a {
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Progress Bars */
.csm-progress-bar {
    background: #f0f0f0;
    border-radius: 10px;
    height: 12px;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
}

.csm-progress-fill {
    height: 100%;
    border-radius: 10px;
    background: #46b450;
    transition: width 0.5s ease, background 0.3s ease;
}

.csm-progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10px;
    line-height: 12px;
    font-weight: bold;
    color: #333;
    text-shadow: 0 0 2px rgba(255,255,255,0.8);
}

/* Warning Messages */
.csm-warning {
    padding: 12px;
    border-radius: 4px;
    margin-top: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.csm-warning.critical {
    background: #dc3232;
    color: white;
    border: 1px solid #c00;
}

.csm-warning.high {
    background: #ffb900;
    color: #000;
    border: 1px solid #e6a700;
}

.csm-warning.medium {
    background: #fff8e5;
    border: 1px solid #ffb900;
    color: #000;
}

/* ==================== 2. DASHBOARD WIDGETS ==================== */

.csm-dashboard-widget {
    padding: 15px;
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.csm-dashboard-widget .csm-progress-bar {
    height: 20px;
    margin: 10px 0;
}

.csm-dashboard-widget .csm-progress-text {
    line-height: 20px;
    font-size: 12px;
}

.csm-dashboard-widget p {
    margin: 8px 0;
    font-size: 13px;
}

.csm-dashboard-widget a {
    text-decoration: none;
    color: #0073aa;
}

.csm-dashboard-widget a:hover {
    color: #00a0d2;
}

/* ==================== 3. USER MEDIA PAGE ==================== */

/* My Media Page Table */
.csm-user-media-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.csm-user-media-table th {
    background: #f1f1f1;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #ccd0d4;
    font-weight: 600;
}

.csm-user-media-table td {
    padding: 12px;
    border-bottom: 1px solid #ccd0d4;
    vertical-align: middle;
}

.csm-user-media-table tr:hover {
    background: #f9f9f9;
}

.csm-file-type {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 3px;
    font-size: 12px;
    text-transform: uppercase;
    cursor: help;
}

.csm-file-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.csm-file-actions .button {
    font-size: 12px;
    padding: 4px 10px;
    min-height: 28px;
    line-height: 1.2;
}

/* Upload Button */
.csm-upload-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
}

/* ==================== 4. POST MANAGEMENT STYLES ==================== */

/* My Posts Menu Indicator */
#menu-posts .wp-menu-name {
    position: relative;
}

#menu-posts .wp-menu-name::after {
    content: "(My)";
    margin-left: 5px;
    font-size: 0.8em;
    opacity: 0.7;
}

/* Post List Enhancements */
.posts-page .wrap h1 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.posts-page .wrap h1::before {
    content: "📝";
}

/* Author Column Hidden */
.column-author {
    display: none !important;
}

/* Author Filter Hidden */
.author-filter {
    display: none !important;
}

/* Post Edit Page - Author Field */
#authordiv {
    display: none !important;
}

.inline-edit-author {
    display: none !important;
}

/* Quick Edit Author */
.inline-edit-row fieldset .inline-edit-author {
    display: none !important;
}

/* Post Storage Metabox */
#csm-post-storage {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#csm-post-storage h2 {
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

#csm-post-storage .csm-progress-bar {
    margin: 15px 0;
}

/* Post Actions in List Table */
.csm-post-actions {
    display: flex;
    gap: 5px;
}

.csm-post-actions .button {
    font-size: 12px;
    padding: 2px 8px;
    height: auto;
    line-height: 1.4;
}

/* ==================== 5. FRONTEND STYLES ==================== */

/* Frontend Storage Status */
.csm-frontend-library {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.csm-frontend-library h3 {
    margin-top: 0;
    color: #23282d;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.csm-frontend-library p {
    margin: 15px 0;
    color: #666;
}

.csm-frontend-library .button {
    margin-top: 10px;
}

/* Frontend Storage Status Shortcode */
.csm-storage-status {
    background: #f9f9f9;
    padding: 15px;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
    margin: 15px 0;
}

.csm-storage-status p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.csm-storage-status strong {
    color: #23282d;
}

/* Frontend User Posts */
.csm-user-posts {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 20px 0;
}

.csm-user-posts h3 {
    margin-top: 0;
    color: #23282d;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.csm-posts-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.csm-post-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.csm-post-item:last-child {
    border-bottom: none;
}

.csm-post-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 4px;
}

.csm-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.csm-post-content {
    flex: 1;
}

.csm-post-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.csm-post-content h4 a {
    text-decoration: none;
    color: #0073aa;
}

.csm-post-content h4 a:hover {
    color: #00a0d2;
}

.csm-post-date {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.csm-post-content p {
    margin: 0 0 10px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.csm-posts-pagination {
    margin: 20px 0;
    text-align: center;
}

/* Frontend Create Post Form */
.csm-create-post {
    background: #fff;
    padding: 25px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.csm-create-post h3 {
    margin-top: 0;
    color: #23282d;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.csm-create-post label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #23282d;
}

.csm-create-post input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

.csm-create-post textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    font-family: monospace;
    resize: vertical;
}

.csm-create-post .button {
    margin-right: 10px;
}

/* ==================== 6. ADMIN COLUMNS & UI ==================== */

/* Users List Storage Columns */
.column-storage_limit,
.column-storage_usage {
    width: 120px;
}

.column-storage_limit .dashicons,
.column-storage_usage .dashicons {
    vertical-align: middle;
    margin-right: 5px;
    color: #0073aa;
}

/* Storage Limit Field in User Profile */
.user-storage-limit-wrap {
    background: #f9f9f9;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 15px 0;
}

.user-storage-limit-wrap h3 {
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.user-storage-limit-wrap .description {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 5px;
}

/* ==================== 7. MEDIA UPLOADER INTEGRATION ==================== */

/* Media Uploader Storage Notice */
.csm-media-uploader-notice {
    background: #f0f8ff;
    border-left: 4px solid #2196F3;
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.csm-media-uploader-notice p {
    margin: 0 0 8px 0;
    font-weight: 500;
}

.csm-media-uploader-notice .csm-progress-bar {
    margin: 8px 0;
}

/* Media Library Bulk Actions */
.tablenav .csm-media-notice {
    margin: 0 15px;
    padding: 10px 15px;
    display: inline-block;
    vertical-align: middle;
}

/* ==================== 8. RESPONSIVE DESIGN ==================== */

@media screen and (max-width: 782px) {
    /* Responsive Tables */
    .csm-user-media-table th,
    .csm-user-media-table td {
        padding: 8px;
        font-size: 13px;
    }
    
    .csm-file-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .csm-file-actions .button {
        width: 100%;
        justify-content: center;
    }
    
    /* Responsive Post Items */
    .csm-post-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .csm-post-thumbnail {
        width: 100%;
        height: 150px;
    }
    
    /* Responsive Form Elements */
    .csm-create-post input[type="text"],
    .csm-create-post textarea {
        font-size: 16px; /* Prevents zoom on mobile */
    }
    
    /* Hide columns on mobile */
    .csm-user-media-table .column-date,
    .csm-user-media-table .column-size {
        display: none;
    }
}

@media screen and (max-width: 600px) {
    /* Full width on mobile */
    .csm-frontend-library,
    .csm-user-posts,
    .csm-create-post,
    .csm-storage-status {
        margin-left: -10px;
        margin-right: -10px;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    
    /* Stack buttons on mobile */
    .csm-upload-button,
    .csm-create-post .button-group {
        flex-direction: column;
        width: 100%;
    }
    
    .csm-upload-button .button,
    .csm-create-post .button {
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }
}

/* ==================== 10. POST ENHANCEMENT STYLES (FROM POST-STYLES.CSS) ==================== */

/* Post Editor Container */
.post-php #poststuff,
.post-new-php #poststuff {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    margin: 20px 0;
    overflow: hidden;
    animation: csmFadeIn 0.5s ease-out;
}

/* Title styling */
#titlediv {
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    border-bottom: 1px solid #e0e0e0;
}

#titlewrap {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#titlewrap:focus-within {
    border-color: #fff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

#title {
    background: transparent;
    border: none;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    padding: 20px;
    height: auto;
    min-height: 60px;
    width: 100%;
}

#title::placeholder {
    color: #95a5a6;
    font-weight: 400;
}

/* Editor area */
.wp-editor-wrap {
    border: none;
    margin: 0;
    border-radius: 0;
}

#wp-content-editor-container {
    border: none;
    border-radius: 0;
}

#wp-content-editor {
    background: #f8f9fa;
    border: none;
    padding: 25px;
    min-height: 400px;
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
}

/* Editor toolbar */
.wp-editor-tools {
    background: #f8f9fa;
    padding: 15px 25px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wp-switch-editor {
    padding: 12px 20px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    font-weight: 600;
    border-radius: 6px;
    margin-right: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.wp-switch-editor:hover,
.wp-switch-editor.wp-switch-editor-active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.wp-media-buttons {
    margin-right: 15px;
}

.wp-media-buttons .button {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.wp-media-buttons .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

/* Post publish box */
#submitdiv {
    background: #fff;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

#submitdiv .hndle {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    padding: 20px;
    border: none;
    font-size: 18px;
    font-weight: 700;
}

#submitdiv .inside {
    padding: 25px;
}

#major-publishing-actions {
    border-top: 1px solid #e9ecef;
    padding: 20px 0 0;
    margin-top: 20px;
}

#publish {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    height: auto;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    width: 100%;
    cursor: pointer;
}

#publish:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

#save-post {
    background: #6c757d;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
}

#save-post:hover {
    background: #5a6268;
}

/* Posts list table */
.wp-list-table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.wp-list-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 10px;
    font-weight: 700;
    font-size: 14px;
}

.wp-list-table tbody td {
    padding: 15px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.wp-list-table tbody tr:hover {
    background: #f8f9ff;
}

/* Post titles in list */
.row-title {
    color: #2c3e50;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.row-title:hover {
    color: #667eea;
}

/* Post status indicators */
.post-state {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.status-publish {
    background: rgba(67, 233, 123, 0.1);
    color: #27ae60;
}

.status-draft {
    background: rgba(255, 193, 7, 0.1);
    color: #f39c12;
}

.status-pending {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.status-private {
    background: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
}

/* Action buttons in list */
.row-actions {
    opacity: 0;
    transition: opacity 0.3s ease;
}

tr:hover .row-actions {
    opacity: 1;
}

.row-actions a {
    color: #6c757d;
    text-decoration: none;
    margin-right: 8px;
    font-size: 12px;
    transition: color 0.3s ease;
}

.row-actions a:hover {
    color: #667eea;
}

.row-actions .trash a {
    color: #e74c3c;
}

.row-actions .trash a:hover {
    color: #c0392b;
}

/* Bulk actions and filters */
.tablenav {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tablenav .actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tablenav .button {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tablenav .button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* View filters */
.views {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.views a {
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    color: #6c757d;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.views a:hover,
.views a.current {
    background: #667eea;
    color: white;
}

/* Storage indicator */
.csm-storage-indicator {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 12px;
    padding: 20px;
    color: white;
    margin-bottom: 20px;
    animation: csmSlideIn 0.3s ease-out;
}

.csm-storage-indicator h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 700;
}

.csm-storage-progress {
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.csm-storage-progress-fill {
    height: 100%;
    background: white;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.csm-storage-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    opacity: 0.9;
}

/* Animations */
@keyframes csmFadeIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes csmSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes csmSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading animation */
.csm-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: csmSpin 1s linear infinite;
}

/* Character counter */
#title-character-counter {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    text-align: right;
}

/* Word count display */
#word-count-display {
    margin-left: auto;
    font-size: 12px;
    color: #666;
}

/* Auto-save indicator */
#auto-save-indicator {
    font-size: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Preview tooltip */
.post-preview-tooltip {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    z-index: 10000;
    max-width: 300px;
}

/* Keyboard shortcuts */
.keyboard-shortcuts {
    font-size: 11px;
    color: #666;
    margin-top: 10px;
    text-align: center;
}