/**
 * Client Portal Manager - Admin Styles
 * Simple and clean WordPress admin styling
 */

/* Edit Section */
.cpm-edit-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-left: 4px solid #0073aa;
    padding: 20px;
    margin: 20px 0;
    border-radius: 3px;
}

.cpm-edit-section h2 {
    margin-top: 0;
    color: #0073aa;
    font-size: 18px;
}

.cpm-edit-section:nth-child(even) {
    border-left-color: #00a32a;
}

.cpm-edit-section:nth-child(odd) h2 {
    color: #0073aa;
}

.cpm-edit-section:nth-child(even) h2 {
    color: #00a32a;
}

/* File Preview */
[id^="cpm-file-preview-"] {
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    display: none;
}

[id^="cpm-file-preview-"].has-file {
    display: block;
}

[id^="cpm-file-preview-"] .file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

[id^="cpm-file-preview-"] .file-icon {
    width: 32px;
    height: 32px;
    background: #dc3232;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-weight: bold;
    font-size: 12px;
}

/* Downloads List */
.cpm-downloads-list {
    margin-top: 30px;
}

.cpm-downloads-list .wp-list-table {
    margin-top: 15px;
}

/* Status indicators */
.cpm-active {
    color: #46b450;
    font-weight: bold;
}

.cpm-inactive {
    color: #dc3232;
    font-weight: bold;
}

.cpm-status-toggle {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.cpm-status-toggle:hover {
    background-color: #f0f0f0;
}

/* Usage Info */
.cpm-usage-info {
    margin-top: 40px;
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 3px;
}

.cpm-usage-info h2 {
    color: #0073aa;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.cpm-usage-info h3 {
    color: #555;
    margin-top: 25px;
    margin-bottom: 10px;
}

.cpm-usage-info code {
    display: block;
    background: #f7f7f7;
    padding: 10px;
    border-left: 4px solid #0073aa;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
}

/* Responsive */
@media (max-width: 782px) {
    .cpm-upload-section {
        padding: 15px;
    }
    
    .wp-list-table .column-title {
        width: auto;
    }
    
    .wp-list-table td, .wp-list-table th {
        font-size: 14px;
    }
}

/* Loading states */
.cpm-loading {
    opacity: 0.6;
    pointer-events: none;
}

.cpm-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #0073aa;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: cpm-spin 1s linear infinite;
}

@keyframes cpm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Buttons */
.cpm-edit-download {
    margin-right: 5px;
}

/* Notices */
.cpm-notice {
    margin: 15px 0;
    padding: 12px;
    border-radius: 3px;
}

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

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

/* Form styling */
.form-table th {
    padding-left: 0;
}

.form-table td input[type="text"],
.form-table td input[type="number"] {
    width: 100%;
    max-width: 400px;
}

#cpm-media-button {
    margin-bottom: 10px;
}

/* Edit form (if added later) */
.cpm-edit-form {
    display: none;
    background: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    margin: 15px 0;
    border-radius: 3px;
}

.cpm-edit-form.active {
    display: block;
}

/* Shortcode examples */
.cpm-shortcode-example {
    background: #f7f7f7;
    border: 1px solid #ddd;
    padding: 15px;
    margin: 15px 0;
    border-radius: 3px;
}

.cpm-shortcode-example h4 {
    margin-top: 0;
    color: #0073aa;
}

.cpm-shortcode-example code {
    background: #fff;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    display: inline-block;
    margin: 5px 0;
}

/* Plugin header styling */
.cpm-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.cpm-header .dashicons {
    color: #0073aa;
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.cpm-header h1 {
    margin: 0;
    color: #23282d;
}

.cpm-header .version {
    background: #0073aa;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: normal;
}

/* Frontend Download Link Styles */
.cpm-download-link {
    display: inline;
    color: #000000 !important;
    text-decoration: underline !important;
    border: none;
    background: none;
    padding: 0;
    font-weight: normal;
}

.cpm-download-link:hover {
    color: #000000 !important;
    text-decoration: underline !important;
}

.cpm-download-link:before {
    content: "";
    margin: 0;
}

/* Elementor CPM Download Button Styles */
.elementor-button.cpm-download-button {
    display: inline;
    color: #000000 !important;
    text-decoration: underline !important;
    border: none;
    background: none;
    padding: 0;
    font-weight: normal;
}