/**
 * Geek Blocks Frontend Styles
 * Compatible with WordPress 2025 Theme and modern standards
 */

/* Reset and Base Styles */
.wp-block-geek-blocks-menu-block,
.wp-block-geek-blocks-popular-tags,
.wp-block-geek-blocks-post-tags,
.wp-block-geek-blocks-author-info {
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.5;
}

/* Menu Block Styles */
.geek-menu-block {
    margin: 16px 0;
}

.geek-menu-block.layout-vertical .geek-menu-list {
    flex-direction: column;
    gap: 8px;
}

.geek-menu-block.layout-horizontal .geek-menu-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
}

.geek-menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.geek-menu-item {
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.geek-menu-item:hover {
    transform: translateY(-1px);
}

.geek-menu-item .dashicons {
    transition: color 0.3s ease;
}

/* Icon Styles for Menu */
.geek-menu-item .dashicons {
    width: auto;
    height: auto;
    flex-shrink: 0;
    transition: color 0.3s ease;
    vertical-align: middle;
}

.geek-menu-item .geek-custom-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.geek-custom-icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

/* Tags Blocks Styles */
.geek-popular-tags {
    margin: 20px 0;
}

.geek-popular-tags-title {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #1e40af;
}

.geek-popular-tags-title .title-hash-icon {
    margin-left: 8px;
    color: #3b82f6;
    font-size: 20px;
    font-weight: bold;
}

.geek-tags-container {
    gap: 8px;
}

.geek-tags-container.layout-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.geek-tags-container.layout-horizontal {
    display: flex;
    flex-wrap: wrap;
}

.geek-tags-container.layout-vertical {
    display: flex;
    flex-direction: column;
}

.geek-tag {
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.geek-tag-card {
    background-color: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #1e40af;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.geek-tag-card:hover {
    background-color: #dbeafe;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.geek-tag-badge,
.geek-tag-link,
.geek-tag-button {
    padding: 4px 8px;
    background-color: #f0f0f1;
    border-radius: 3px;
    font-size: 14px;
    margin: 4px;
    display: inline-flex;
    align-items: center;
}

.geek-tag-hash {
    font-weight: 500;
    margin-left: 4px;
}

.geek-tag-card .geek-tag-hash {
    color: #3b82f6;
}

.geek-tag-name {
    font-weight: normal;
}

.geek-tag-card .geek-tag-name {
    font-weight: 500;
}

.geek-tag-count {
    font-size: 0.9em;
    opacity: 0.8;
}

.geek-tag-card .geek-tag-count {
    color: #6b7280;
    font-weight: 600;
    background-color: #f3f4f6;
    border-radius: 12px;
    padding: 2px 8px;
    opacity: 1;
}

.tag-content {
    display: flex;
    align-items: center;
}

/* Tag Style Variations */
.geek-tag-badge {
    background-color: var(--wp--preset--color--light-gray, #f0f0f0);
    color: var(--wp--preset--color--dark-gray, #333);
    border: 1px solid transparent;
}

.geek-tag-link {
    background: transparent;
    color: var(--wp--preset--color--primary, #007cba);
    border: none;
    text-decoration: underline;
}

.geek-tag-button {
    background-color: var(--wp--preset--color--primary, #007cba);
    color: var(--wp--preset--color--white, #fff);
    border: 1px solid var(--wp--preset--color--primary, #007cba);
}

.geek-tag-button:hover {
    background-color: var(--wp--preset--color--dark-blue, #005a87);
    border-color: var(--wp--preset--color--dark-blue, #005a87);
}

/* Author Info Block */
.geek-author-info {
    margin: 0;
}

.geek-author-content {
    width: 100%;
}

.geek-author-avatar {
    flex-shrink: 0;
}

.geek-author-avatar-img {
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.geek-author-link:hover .geek-author-avatar-img {
    transform: scale(1.05);
}

.geek-author-details {
    min-width: 0; /* Allow text truncation */
}

.geek-author-name {
    font-weight: 600;
    margin: 0;
    word-break: break-word;
}

.geek-author-name-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.geek-author-name-link:hover {
    color: var(--wp--preset--color--primary, #007cba);
    text-decoration: none;
}

.geek-author-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em;
    font-size: 0.875em;
    opacity: 0.8;
}

.geek-category-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.geek-category-link:hover {
    color: var(--wp--preset--color--primary, #007cba);
    text-decoration: underline;
}

/* Layout Variations */
.layout-vertical .geek-author-content {
    flex-direction: column;
    text-align: center;
}

.layout-vertical .geek-author-meta {
    justify-content: center;
}

.layout-grid .geek-tags-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* Alignment Classes */
.alignment-left {
    text-align: left;
}

.alignment-center {
    text-align: center;
}

.alignment-right {
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .geek-tags-container.layout-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .geek-menu-block.layout-horizontal .geek-menu-list {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .geek-tags-container.layout-grid {
        grid-template-columns: 1fr;
    }
}

/* RTL Support */
[dir="rtl"] .geek-menu-item .dashicons {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .geek-popular-tags-title .title-hash-icon {
    margin-right: 8px;
    margin-left: 0;
}

[dir="rtl"] .geek-tag-hash {
    margin-right: 4px;
    margin-left: 0;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .geek-menu-item,
    .geek-tag,
    .geek-author-info {
        border: 1px solid;
    }
    
    .geek-menu-item:focus,
    .geek-tag:focus {
        outline: 3px solid;
        outline-offset: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .geek-menu-item,
    .geek-tag,
    .geek-author-avatar-img,
    .geek-author-name-link,
    .geek-category-link {
        transition: none;
    }
    
    .has-hover-effect:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .geek-menu-item,
    .geek-tag {
        color: #000 !important;
        background: transparent !important;
        text-decoration: underline !important;
    }
    
    .geek-menu-item:after,
    .geek-tag:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    .geek-author-avatar {
        display: none;
    }
    
    .geek-author-info {
        background: transparent !important;
        border: 1px solid #000 !important;
    }
}

/* Empty State Styles */
.geek-popular-tags-empty,
.geek-post-tags-empty,
.geek-author-info-empty {
    padding: 1rem;
    text-align: center;
    font-style: italic;
    opacity: 0.7;
    border: 1px dashed #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
}

/* Post Tags Styles */
.geek-post-tags {
    margin: 16px 0;
}

.geek-post-tags .geek-tags-container {
    gap: 6px;
}

/* Date Time Block Styles */
.geek-date-time {
    margin: 12px 0;
    font-size: 14px;
    color: #666;
}

.geek-date-time .date-label {
    margin-left: 4px;
    font-weight: 500;
}

/* Animation for loading */
.geek-tags-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.geek-tags-loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 