/**
 * DailyTeck Classic V2 - Component Styles
 * Additional components for Electrek-style theme
 */

/* ========================================================================
   Poll Widget (Electrek Style)
   ======================================================================== */

.dt-poll {
    padding: 0;
}

.dt-poll-question {
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.5;
}

.dt-poll-description {
    font-size: 0.85rem;
    color: var(--dt-text-light);
    font-style: italic;
    margin-bottom: 16px;
    line-height: 1.5;
}

.dt-poll-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dt-poll-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
}

.dt-poll-option input[type="radio"] {
    margin-top: 3px;
    accent-color: var(--dt-primary);
}

.dt-poll-option span {
    flex: 1;
}

.dt-poll-submit {
    margin-top: 8px;
    padding: 10px 20px;
    background: var(--dt-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
    transition: background 0.2s;
}

.dt-poll-submit:hover {
    background: var(--dt-primary-dark);
}

.dt-poll-discuss {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--dt-primary);
}

/* ========================================================================
   Forms (General)
   ======================================================================== */

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

.search-field {
    flex: 1;
    padding: 10px 14px;
    font-family: var(--dt-font-body);
    font-size: 0.95rem;
    border: 1px solid var(--dt-border);
    border-radius: 4px 0 0 4px;
    background-color: var(--dt-bg);
    color: var(--dt-text);
}

.search-field:focus {
    border-color: var(--dt-primary);
    outline: none;
}

.search-submit {
    padding: 10px 16px;
    font-family: var(--dt-font-body);
    font-weight: 600;
    background-color: var(--dt-primary);
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background 0.2s;
}

.search-submit:hover {
    background-color: var(--dt-primary-dark);
}

/* ========================================================================
   Buttons
   ======================================================================== */

.dt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--dt-font-body);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.dt-btn--primary {
    background-color: var(--dt-primary);
    color: #fff;
    border: 2px solid var(--dt-primary);
}

.dt-btn--primary:hover {
    background-color: var(--dt-primary-dark);
    border-color: var(--dt-primary-dark);
    color: #fff;
}

.dt-btn--outline {
    background-color: transparent;
    color: var(--dt-primary);
    border: 2px solid var(--dt-primary);
}

.dt-btn--outline:hover {
    background-color: var(--dt-primary);
    color: #fff;
}

/* ========================================================================
   Placeholders
   ======================================================================== */

.dt-card-placeholder,
.dt-article-placeholder,
.dt-widget-item-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8e8e8 0%, #f5f5f5 50%, #e8e8e8 100%);
    background-size: 200% 200%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.dt-theme-dark .dt-card-placeholder,
.dt-theme-dark .dt-article-placeholder,
.dt-theme-dark .dt-widget-item-placeholder {
    background: linear-gradient(135deg, #2a2a2a 0%, #333 50%, #2a2a2a 100%);
}

/* ========================================================================
   Author Bio
   ======================================================================== */

.dt-author-bio {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: var(--dt-surface);
    border-radius: 8px;
    margin-top: 40px;
}

.dt-author-avatar {
    flex-shrink: 0;
}

.dt-author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

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

.dt-author-name {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.dt-author-name a {
    color: var(--dt-text);
}

.dt-author-name a:hover {
    color: var(--dt-primary);
}

.dt-author-role {
    font-size: 0.85rem;
    color: var(--dt-muted);
    margin-bottom: 12px;
}

.dt-author-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--dt-text-light);
}

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

.dt-related {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--dt-border);
}

.dt-related-title {
    font-family: var(--dt-font-heading);
    font-size: 1.5rem;
    font-style: italic;
    margin-bottom: 24px;
}

.dt-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.dt-related-item {
    display: flex;
    gap: 16px;
}

.dt-related-media {
    flex-shrink: 0;
    width: 100px;
    height: 70px;
    border-radius: 4px;
    overflow: hidden;
}

.dt-related-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dt-related-content {
    flex: 1;
    min-width: 0;
}

.dt-related-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
}

.dt-related-item-title a {
    color: var(--dt-text);
}

.dt-related-item-title a:hover {
    color: var(--dt-primary);
}

.dt-related-date {
    font-size: 0.75rem;
    color: var(--dt-muted);
}

/* ========================================================================
   Tags
   ======================================================================== */

.dt-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 30px;
}

.dt-tag {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.8rem;
    background: var(--dt-surface);
    color: var(--dt-text);
    border-radius: 4px;
    transition: all 0.2s;
}

.dt-tag:hover {
    background: var(--dt-primary);
    color: #fff;
}

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

.dt-share {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 30px 0;
}

.dt-share-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dt-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dt-share-buttons {
    display: flex;
    gap: 8px;
}

.dt-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--dt-surface);
    color: var(--dt-muted);
    border-radius: 4px;
    transition: all 0.2s;
}

.dt-share-btn:hover {
    color: #fff;
}

.dt-share-btn--twitter:hover {
    background: #1da1f2;
}

.dt-share-btn--facebook:hover {
    background: #1877f2;
}

.dt-share-btn--linkedin:hover {
    background: #0a66c2;
}

.dt-share-btn--email:hover {
    background: var(--dt-primary);
}

/* ========================================================================
   404 Page
   ======================================================================== */

.dt-404 {
    text-align: center;
    padding: 80px 20px;
}

.dt-404-title {
    font-size: 6rem;
    font-weight: 700;
    color: var(--dt-primary);
    line-height: 1;
    margin-bottom: 16px;
}

.dt-404-subtitle {
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.dt-404-text {
    font-size: 1.1rem;
    color: var(--dt-text-light);
    max-width: 500px;
    margin: 0 auto 32px;
}

/* ========================================================================
   Archive Header
   ======================================================================== */

.dt-archive-header {
    padding: 40px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--dt-border);
}

.dt-archive-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--dt-muted);
    margin-bottom: 8px;
}

.dt-archive-title {
    font-size: 2rem;
    margin-bottom: 8px;
}

.dt-archive-description {
    font-size: 1rem;
    color: var(--dt-text-light);
    max-width: 600px;
}

/* ========================================================================
   Widget Styles
   ======================================================================== */

.widget {
    margin-bottom: 30px;
}

.widget:last-child {
    margin-bottom: 0;
}

/* Category Widget */
.widget_categories ul,
.widget_archive ul,
.widget_pages ul,
.widget_meta ul,
.widget_recent_entries ul,
.widget_recent_comments ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget_categories li,
.widget_archive li,
.widget_pages li,
.widget_meta li,
.widget_recent_entries li,
.widget_recent_comments li {
    padding: 8px 0;
    border-bottom: 1px solid var(--dt-border);
}

.widget_categories li:last-child,
.widget_archive li:last-child,
.widget_pages li:last-child,
.widget_meta li:last-child,
.widget_recent_entries li:last-child,
.widget_recent_comments li:last-child {
    border-bottom: none;
}

.widget_categories a,
.widget_archive a,
.widget_pages a,
.widget_meta a,
.widget_recent_entries a,
.widget_recent_comments a {
    color: var(--dt-text);
    font-size: 0.95rem;
}

.widget_categories a:hover,
.widget_archive a:hover,
.widget_pages a:hover,
.widget_meta a:hover,
.widget_recent_entries a:hover,
.widget_recent_comments a:hover {
    color: var(--dt-primary);
}

/* Calendar Widget */
.widget_calendar table {
    width: 100%;
    border-collapse: collapse;
}

.widget_calendar caption {
    font-weight: 600;
    padding-bottom: 10px;
}

.widget_calendar th,
.widget_calendar td {
    text-align: center;
    padding: 8px;
    font-size: 0.85rem;
}

.widget_calendar th {
    font-weight: 600;
    color: var(--dt-muted);
}

.widget_calendar a {
    color: var(--dt-primary);
    font-weight: 600;
}

/* Tag Cloud Widget */
.widget_tag_cloud .tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.widget_tag_cloud a {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8rem !important;
    background: var(--dt-surface);
    color: var(--dt-text);
    border-radius: 4px;
    transition: all 0.2s;
}

.widget_tag_cloud a:hover {
    background: var(--dt-primary);
    color: #fff;
}

/* RSS Widget */
.widget_rss ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget_rss li {
    padding: 12px 0;
    border-bottom: 1px solid var(--dt-border);
}

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

.widget_rss .rsswidget {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.widget_rss .rss-date {
    font-size: 0.8rem;
    color: var(--dt-muted);
}

.widget_rss .rssSummary {
    font-size: 0.9rem;
    color: var(--dt-text-light);
    margin-top: 6px;
    line-height: 1.5;
}

/* ========================================================================
   Loading States
   ======================================================================== */

.dt-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

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

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

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

.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 !important;
    width: 1px;
    word-wrap: normal !important;
}

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

/* Focus States */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--dt-primary);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
