/**
 * Custom File Service - Public Styles
 */

/* ==========================================================================
   Rating Stars
   ========================================================================== */

.cfs-rating-container {
    margin: 20px 0;
}

.cfs-rating-stars {
    display: inline-flex;
    gap: 5px;
    cursor: pointer;
}

.cfs-rating-stars .star {
    font-size: 24px;
    color: #ddd;
    transition: color 0.2s;
    cursor: pointer;
}

.cfs-rating-stars .star.active,
.cfs-rating-stars .star.hover {
    color: #ffc107;
}

.cfs-rating-average {
    display: inline-block;
    margin-left: 10px;
    font-weight: bold;
    font-size: 18px;
}

.cfs-rating-count {
    display: inline-block;
    margin-left: 5px;
    color: #666;
    font-size: 14px;
}

/* ==========================================================================
   Comments
   ========================================================================== */

.cfs-comments-section {
    margin: 40px 0;
}

.cfs-comments-section h3 {
    margin-bottom: 20px;
    font-size: 24px;
}

.cfs-comment-form {
    margin-bottom: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 4px;
}

.cfs-comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
}

.cfs-comment-form button {
    margin-top: 10px;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.cfs-comment-form button:hover {
    background: #005a87;
}

.cfs-comments-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cfs-comment {
    padding: 15px;
    margin-bottom: 15px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
}

.cfs-comment .comment-meta {
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.cfs-comment .comment-meta strong {
    color: #333;
    margin-right: 10px;
}

.cfs-comment .comment-content {
    margin-bottom: 10px;
    line-height: 1.6;
}

.cfs-comment .comment-actions {
    display: flex;
    gap: 15px;
    font-size: 13px;
}

.cfs-comment .comment-actions a {
    color: #0073aa;
    text-decoration: none;
}

.cfs-comment .comment-actions a:hover {
    text-decoration: underline;
}

.cfs-comment .comment-replies {
    margin-left: 30px;
    margin-top: 15px;
}

.cfs-reply-form {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    display: none;
}

/* ==========================================================================
   Author Profile
   ========================================================================== */

.cfs-author-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    margin: 20px 0;
}

.cfs-author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
}

.cfs-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cfs-author-info {
    flex: 1;
}

.cfs-author-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
}

.cfs-author-bio {
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.cfs-author-likes {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.cfs-author-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 15px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.cfs-author-like-btn:hover {
    background: #e5e5e5;
}

.cfs-author-like-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* ==========================================================================
   File Grid
   ========================================================================== */

.cfs-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.cfs-file-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 20px;
    transition: box-shadow 0.3s;
}

.cfs-file-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cfs-file-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.cfs-file-title a {
    color: #333;
    text-decoration: none;
}

.cfs-file-title a:hover {
    color: #0073aa;
}

.cfs-file-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
}

.cfs-file-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cfs-file-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.cfs-file-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.cfs-file-tag {
    padding: 3px 10px;
    background: #f5f5f5;
    border-radius: 3px;
    font-size: 12px;
    color: #666;
}

.cfs-file-actions {
    display: flex;
    gap: 10px;
}

.cfs-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.2s;
}

.cfs-btn-primary {
    background: #0073aa;
    color: #fff;
}

.cfs-btn-primary:hover {
    background: #005a87;
}

.cfs-btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.cfs-btn-secondary:hover {
    background: #e5e5e5;
}

/* ==========================================================================
   Purchase/Price
   ========================================================================== */

.cfs-file-price {
    font-size: 20px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 15px;
}

.cfs-file-price.free {
    color: #46b450;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.cfs-modal {
    display: block;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.cfs-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 4px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.cfs-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.cfs-modal-close:hover {
    color: #000;
}

.cfs-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.cfs-modal .form-group {
    margin-bottom: 15px;
}

.cfs-modal label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.cfs-modal input,
.cfs-modal select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cfs-modal .form-row {
    display: flex;
    gap: 10px;
}

.cfs-modal .form-row .form-group {
    flex: 1;
}

/* ==========================================================================
   Messages/Notifications
   ========================================================================== */

.cfs-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10001;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s;
}

.cfs-message.show {
    opacity: 1;
    transform: translateX(0);
}

.cfs-message-success {
    border-left: 4px solid #46b450;
}

.cfs-message-error {
    border-left: 4px solid #dc3232;
}

.cfs-message-info {
    border-left: 4px solid #0073aa;
}

/* ==========================================================================
   Download History
   ========================================================================== */

.cfs-download-history {
    margin: 20px 0;
}

.cfs-download-history table {
    width: 100%;
    border-collapse: collapse;
}

.cfs-download-history th,
.cfs-download-history td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.cfs-download-history th {
    background: #f5f5f5;
    font-weight: 600;
}

.cfs-download-history tr:hover {
    background: #fafafa;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .cfs-file-grid {
        grid-template-columns: 1fr;
    }

    .cfs-author-card {
        flex-direction: column;
    }

    .cfs-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    .cfs-file-meta {
        flex-direction: column;
        gap: 5px;
    }
}
