/* VVA Voting System Styles */

/* Form Styles */
.vva-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.vva-form h2 {
    margin-bottom: 25px;
    color: #333;
    text-align: center;
    font-size: 24px;
}

.vva-form .form-group {
    margin-bottom: 20px;
}

.vva-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.vva-form label .required {
    color: #e74c3c;
}

.vva-form .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.vva-form .form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

.vva-form .error-message {
    display: none;
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
}

.vva-form .form-group.has-error .form-control {
    border-color: #e74c3c;
}

.vva-form .form-group.has-error .error-message {
    display: block;
}

.vva-form .btn {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.vva-form .btn-primary {
    background: #3498db;
    color: #fff;
}

.vva-form .btn-primary:hover {
    background: #2980b9;
}

.vva-form .btn-block {
    width: 100%;
}

.vva-form .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vva-form .form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    display: none;
}

.vva-form .form-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.vva-form .form-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.vva-form .form-footer {
    margin-top: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.vva-form .form-footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.vva-form .form-footer a:hover {
    text-decoration: underline;
}

/* User Info Styles */
.vva-user-info {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    gap: 15px;
}

.vva-user-info .user-avatar {
    font-size: 48px;
    color: #3498db;
}

.vva-user-info .user-details h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 18px;
}

.vva-user-info .user-details p {
    margin: 3px 0;
    color: #666;
    font-size: 14px;
}

.vva-user-info .user-actions {
    margin-left: auto;
}

.vva-user-info .btn-secondary {
    background: #95a5a6;
    color: #fff;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.vva-user-info .btn-secondary:hover {
    background: #7f8c8d;
}

/* Vote Button Styles */
.vva-vote-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.vva-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #fff;
    border: 2px solid #e74c3c;
    border-radius: 50px;
    color: #e74c3c;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.vva-vote-btn:hover:not(:disabled) {
    background: #e74c3c;
    color: #fff;
    transform: scale(1.05);
}

.vva-vote-btn.voted {
    background: #e74c3c;
    color: #fff;
}

.vva-vote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vva-vote-btn .vote-icon {
    font-size: 20px;
}

.vva-vote-count {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 20px;
    color: #e74c3c;
    font-weight: 600;
}

.vva-vote-count i {
    color: #e74c3c;
}

.vote-message {
    color: #666;
    font-size: 14px;
}

.vote-message a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.vote-message a:hover {
    text-decoration: underline;
}

/* Top Voted Posts */
.vva-top-voted-posts {
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.vva-top-voted-posts h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.top-posts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.top-post-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: transform 0.3s;
}

.top-post-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.top-post-item .post-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #3498db;
    color: #fff;
    border-radius: 50%;
    font-weight: bold;
    font-size: 18px;
}

.top-post-item .post-info {
    flex: 1;
}

.top-post-item h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.top-post-item h4 a {
    color: #333;
    text-decoration: none;
}

.top-post-item h4 a:hover {
    color: #3498db;
}

.top-post-item .vote-count {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #e74c3c;
    font-size: 14px;
}

/* Loading State */
.vva-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.vva-form.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .vva-form {
        padding: 20px;
    }
    
    .vva-vote-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .vva-user-info {
        flex-direction: column;
        text-align: center;
    }
    
    .vva-user-info .user-actions {
        margin-left: 0;
    }
}

/* Modal Styles */
.vva-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s;
}

.vva-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vva-modal-content {
    position: relative;
    background-color: #fff;
    padding: 0;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

.vva-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    z-index: 1;
}

.vva-modal-close:hover {
    color: #333;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Avatar Upload Styles */
.avatar-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f5f5f5;
}

.avatar-preview i {
    font-size: 60px;
    color: #999;
}

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

.avatar-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avatar-upload-controls .btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.vva-form label .optional {
    color: #999;
    font-weight: normal;
    font-size: 13px;
}

/* Admin Avatar Edit */
.vva-avatar-cell {
    width: 60px;
}

.vva-avatar-thumb {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
}

.vva-avatar-thumb.no-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #999;
    font-size: 24px;
}

.edit-avatar-btn {
    margin-top: 5px;
    font-size: 12px;
}

/* Avatar Modal */
.vva-avatar-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.vva-avatar-modal-content {
    background: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

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

.vva-avatar-modal-close:hover {
    color: #333;
}

.vva-avatar-modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.vva-avatar-modal-preview {
    text-align: center;
    margin-bottom: 20px;
}

.vva-avatar-modal-preview img,
.vva-avatar-modal-preview .no-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ddd;
    margin: 0 auto;
}

.vva-avatar-modal-preview .no-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #999;
    font-size: 60px;
}

.vva-avatar-modal-actions {
    text-align: center;
}
