/**
 * Custom Styles for BrandaDoc Theme
 *
 * Additional styles, animations, utilities, and enhancements.
 *
 * @package BrandaDoc
 * @since 2.0.0
 */

/* ==========================================================================
   Animations
   ========================================================================== */

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   Selection & Focus States
   ========================================================================== */

::selection {
    background: var(--primary-color);
    color: var(--white);
}

a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */

.spinner {
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination,
.nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span,
.nav-links a,
.nav-links span {
    padding: 10px 15px;
    background: var(--white);
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    transition: var(--transition);
    text-decoration: none;
}

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

/* ==========================================================================
   Single Post Styles
   ========================================================================== */

.featured-image {
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.entry-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.entry-meta a {
    color: var(--primary-color);
    text-decoration: none;
}

.entry-meta a:hover {
    text-decoration: underline;
}

.entry-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--medium-gray);
}

.entry-tags a {
    display: inline-block;
    padding: 5px 12px;
    background: var(--light-gray);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    font-size: 0.85rem;
    text-decoration: none;
    margin: 0 5px 5px 0;
    transition: var(--transition);
}

.entry-tags a:hover {
    background: var(--primary-color);
    color: var(--white);
}

.post-navigation {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--medium-gray);
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.post-navigation a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.post-navigation a:hover {
    color: var(--secondary-color);
}

/* ==========================================================================
   Comment Form
   ========================================================================== */

.comments-area {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--medium-gray);
}

.comments-title {
    margin-bottom: 30px;
}

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

.comment-list li {
    padding: 20px 0;
    border-bottom: 1px solid var(--light-gray);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.comment-author img {
    border-radius: 50%;
}

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

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

.comment-metadata a {
    color: var(--text-light);
    text-decoration: none;
}

.comment-content p {
    margin-bottom: 10px;
}

.reply a {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius-sm);
    margin-bottom: 15px;
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    outline: none;
}

.comment-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.comment-reply-title {
    margin-bottom: 20px;
}

/* ==========================================================================
   Social Share Buttons
   ========================================================================== */

.social-share {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--medium-gray);
}

.social-share span {
    font-weight: 500;
    margin-right: 5px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.share-btn.facebook { background: #3b5998; }
.share-btn.twitter { background: #000; }
.share-btn.linkedin { background: #0077b5; }
.share-btn.whatsapp { background: #25d366; }

/* ==========================================================================
   Related Posts
   ========================================================================== */

.related-posts {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--medium-gray);
}

.related-posts h3 {
    margin-bottom: 20px;
}

/* ==========================================================================
   Reading Time
   ========================================================================== */

.reading-time {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ==========================================================================
   Back to Top Button
   ========================================================================== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    font-size: 1.2rem;
}

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

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

/* ==========================================================================
   Accessibility
   ========================================================================== */

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: var(--light-gray);
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: var(--primary-color);
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ==========================================================================
   Search Form
   ========================================================================== */

.search-form {
    display: flex;
    gap: 0;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--medium-gray);
    border-right: none;
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
    font-family: var(--font-primary);
    font-size: 1rem;
}

.search-form input[type="search"]:focus {
    border-color: var(--primary-color);
    outline: none;
}

.search-form .search-submit {
    padding: 12px 20px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: var(--transition);
}

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

.search-form.focused input[type="search"] {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

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

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 600px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .sidebar,
    .navigation,
    .comment-respond,
    .back-to-top,
    .social-share,
    .post-navigation {
        display: none;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    a {
        text-decoration: underline;
        color: #000;
    }

    img {
        max-width: 100% !important;
    }
}
