/**
 * The World Merchants Custom CSS
 *
 * Additional custom styles beyond main stylesheet
 */

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

/* Mobile Navigation */
.mobile-navigation {
    display: none;
    background: var(--dark-color);
    padding: 20px;
}

.mobile-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-navigation li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-navigation a {
    color: white;
    display: block;
    padding: 15px 0;
}

.mobile-navigation a:hover {
    color: var(--accent-color);
}

/* Sticky Header */
.site-header.sticky {
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

/* Form Messages */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

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

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

/* Form Error State */
input.error,
textarea.error,
select.error {
    border-color: var(--error-color) !important;
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .back-to-top,
    .mobile-menu-toggle,
    .hero-buttons {
        display: none !important;
    }

    .hero-section {
        background: white !important;
        color: black !important;
        padding: 20px 0 !important;
    }

    .hero-section h1 {
        color: black !important;
    }

    a {
        text-decoration: underline;
    }

    .page-break {
        page-break-before: always;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility Improvements */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 15px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Screen Reader Text */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Widget Styles */
.widget {
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.widget li:last-child {
    border-bottom: none;
}

/* Search Form */
.search-form {
    display: flex;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.search-form button {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-form button:hover {
    background: var(--secondary-color);
}

/* Comments */
.comments-section {
    margin-top: 60px;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    padding: 20px;
    background: var(--light-color);
    border-radius: 8px;
    margin-bottom: 20px;
}

.comment-meta {
    margin-bottom: 15px;
}

.comment-author {
    font-weight: 600;
}

.comment-metadata {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Responsive Tables */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
