/**
 * TrustGate Author Hub - Main Stylesheet
 * Contains all frontend and admin styles
 */

/* ==========================================================================
   Admin Styles
   ========================================================================== */

/* Author Info Display */
.author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-avatar-placeholder {
    background: #0073aa;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.author-details h3 {
    margin: 0;
}

.author-bio {
    color: #666;
    font-style: italic;
    max-width: 300px;
}

.author-stats {
    font-size: 12px;
    line-height: 1.4;
}

/* Role Badges */
.role-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
}

.role-pending {
    background: #dba617;
    color: white;
}

.role-verified {
    background: #00a32a;
    color: white;
}

.role-trusted {
    background: #0073aa;
    color: white;
}

/* Modal Styles */
.author-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-modal-content {
    background: white;
    border-radius: 4px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.author-modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.author-modal-header h2 {
    margin: 0;
    color: #23282d;
}

.author-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.author-modal-close:hover {
    background: rgba(0,0,0,0.1);
}

.author-modal-body {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.author-modal-footer {
    padding: 20px;
    border-top: 1px solid #ddd;
    text-align: right;
    background: #f8f9fa;
}

.author-modal-footer .button {
    margin-left: 10px;
}

/* Author Details Modal Content */
.author-details-full .author-header {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    align-items: flex-start;
}

.author-photo-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-info h3 {
    margin: 0 0 10px 0;
    color: #23282d;
    font-size: 24px;
}

.author-info p {
    margin: 5px 0;
    color: #555;
}

.profile-section,
.social-section,
.stats-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.profile-section:last-child,
.social-section:last-child,
.stats-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.profile-section h4,
.social-section h4,
.stats-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #23282d;
    font-size: 16px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.profile-section p,
.social-section p,
.stats-section p {
    margin-bottom: 10px;
    line-height: 1.5;
}

/* Bulk Actions */
#new-role-selector {
    margin-left: 10px;
    min-width: 150px;
}

.search-form {
    float: right;
    margin-top: 10px;
}

/* Add Author Form Styles */
.form-sections {
    max-width: 800px;
}

.form-section {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-bottom: 20px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
    color: #23282d;
    font-size: 18px;
}

.required {
    color: #d63638;
    font-weight: bold;
}

.form-table th {
    width: 200px;
    vertical-align: top;
    padding-top: 10px;
    font-weight: 600;
}

.form-table td {
    vertical-align: top;
    padding-bottom: 15px;
}

.form-table p.description {
    margin-top: 5px;
    margin-bottom: 0;
    color: #646970;
    font-style: italic;
    font-size: 13px;
}

#profile-photo-preview {
    margin-top: 10px;
}

#profile-photo-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Notice Styles */
.notice {
    padding: 12px;
    margin: 15px 0;
    border-left: 4px solid #00a32a;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.notice.error {
    border-left-color: #d63638;
}

.notice.warning {
    border-left-color: #dba617;
}

.notice p {
    margin: 0;
}

.notice-dismiss {
    float: right;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Row Actions Styling */
.row-actions {
    margin-top: 8px;
}

.row-actions span {
    display: inline;
}

.row-actions a {
    text-decoration: none;
    color: #0073aa;
}

.row-actions a:hover {
    color: #005177;
    text-decoration: underline;
}

/* Column Specific Styles */
.column-author {
    width: 25%;
}

.column-email {
    width: 20%;
}

.column-role {
    width: 12%;
}

.column-stats {
    width: 15%;
}

.column-registered {
    width: 15%;
}

.column-status {
    width: 13%;
}

/* Table Enhancements */
.wp-list-table .author-info {
    align-items: flex-start;
}

.wp-list-table .author-details {
    flex: 1;
    min-width: 0;
}

.wp-list-table .author-details strong {
    display: block;
    margin-bottom: 2px;
}

.wp-list-table .author-details small {
    display: block;
    color: #666;
    font-size: 12px;
    line-height: 1.3;
}

/* Status Indicators */
.status-approved {
    color: #00a32a;
    font-weight: 600;
}

.status-pending {
    color: #dba617;
    font-weight: 600;
}

.status-rejected {
    color: #d63638;
    font-weight: 600;
}

/* Form Validation */
.form-table input.error,
.form-table textarea.error,
.form-table select.error {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 1px #d63638;
}

.form-table input.success,
.form-table textarea.success,
.form-table select.success {
    border-color: #00a32a !important;
    box-shadow: 0 0 0 1px #00a32a;
}

/* Responsive Design */
@media (max-width: 782px) {
    .author-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .author-details-full .author-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .form-table th,
    .form-table td {
        display: block;
        width: 100% !important;
        padding: 5px 0;
    }
    
    .form-table th {
        padding-top: 15px;
        font-weight: bold;
    }
    
    .author-info {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .author-modal-body {
        padding: 15px;
    }
    
    .author-modal-header,
    .author-modal-footer {
        padding: 15px;
    }
    
    .profile-section h4,
    .social-section h4,
    .stats-section h4 {
        font-size: 14px;
    }
}

/* ==========================================================================
   Frontend Styles
   ========================================================================== */

/* Author Registration Form */
.trustgate-register-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.trustgate-register-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #23282d;
}

.trustgate-form-row {
    margin-bottom: 20px;
}

.trustgate-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.trustgate-form-row input,
.trustgate-form-row textarea,
.trustgate-form-row select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.trustgate-form-row input:focus,
.trustgate-form-row textarea:focus,
.trustgate-form-row select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.trustgate-form-submit {
    text-align: center;
    margin-top: 30px;
}

.trustgate-submit-btn {
    background: #0073aa;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.trustgate-submit-btn:hover {
    background: #005177;
}

/* Author Dashboard Styles */
.trustgate-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0073aa;
}

.dashboard-header h1 {
    margin: 0;
    color: #23282d;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 24px;
}

.stat-card p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Author Box Styles */
.trustgate-author-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.author-box-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.author-box-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.author-box-info h4 {
    margin: 0 0 5px 0;
    color: #23282d;
    font-size: 18px;
}

.author-box-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.author-box-bio {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #333;
}

.author-box-social {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.author-box-social a {
    padding: 5px 10px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    transition: background-color 0.3s;
}

.author-box-social a:hover {
    background: #005177;
}

/* Public Author Profile Styles */
.trustgate-author-profile {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.author-profile-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: white;
    border-radius: 12px;
}

.author-profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px;
    display: block;
    border: 4px solid white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.author-profile-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
}

.author-profile-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.author-profile-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.author-profile-main {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.author-profile-sidebar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .author-profile-content {
        grid-template-columns: 1fr;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .author-box-header {
        flex-direction: column;
        text-align: center;
    }
    
    .trustgate-register-form {
        margin: 20px;
        padding: 15px;
    }
}