/**
 * YH2UD QSL Card Downloader - Stylesheet
 * Desain modern, responsif, dan ringan
 */

:root {
    --yh2ud-primary: #2563eb;
    --yh2ud-primary-hover: #1d4ed8;
    --yh2ud-primary-light: #eff6ff;
    --yh2ud-text-main: #0f172a;
    --yh2ud-text-muted: #64748b;
    --yh2ud-border: #e2e8f0;
    --yh2ud-bg-card: #ffffff;
    --yh2ud-radius: 12px;
    --yh2ud-radius-sm: 8px;
    --yh2ud-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --yh2ud-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

.yh2ud-wrapper {
    max-width: 960px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--yh2ud-text-main);
    box-sizing: border-box;
}

.yh2ud-wrapper * {
    box-sizing: border-box;
}

/* ==================== SEARCH CARD ==================== */
.yh2ud-search-card {
    background: var(--yh2ud-bg-card);
    border: 1px solid var(--yh2ud-border);
    border-radius: var(--yh2ud-radius);
    padding: 2.2rem 2rem;
    box-shadow: var(--yh2ud-shadow);
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.yh2ud-search-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #38bdf8, #10b981);
}

.yh2ud-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--yh2ud-text-main);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.yh2ud-subtitle {
    font-size: 0.98rem;
    color: var(--yh2ud-text-muted);
    margin: 0 auto 1.8rem auto;
    max-width: 600px;
    line-height: 1.5;
}

.yh2ud-search-form {
    max-width: 520px;
    margin: 0 auto;
}

.yh2ud-input-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.yh2ud-input-icon {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.yh2ud-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--yh2ud-text-main);
    background: #f8fafc;
    border: 2px solid var(--yh2ud-border);
    border-radius: var(--yh2ud-radius-sm);
    transition: all 0.2s ease;
    outline: none;
}

.yh2ud-input:focus {
    background: #ffffff;
    border-color: var(--yh2ud-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.yh2ud-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff !important;
    background: var(--yh2ud-primary);
    border: none;
    border-radius: var(--yh2ud-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.yh2ud-btn-submit:hover {
    background: var(--yh2ud-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.yh2ud-btn-submit:active {
    transform: translateY(0);
}

.yh2ud-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: yh2ud-spin 0.8s linear infinite;
}

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

/* Quick tags */
.yh2ud-quick-tags {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
}

.yh2ud-tags-label {
    color: var(--yh2ud-text-muted);
}

.yh2ud-tag-pill {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.yh2ud-tag-pill:hover {
    background: var(--yh2ud-primary-light);
    color: var(--yh2ud-primary);
    border-color: #93c5fd;
}

/* ==================== RESULTS BOX ==================== */
.yh2ud-results-box {
    background: var(--yh2ud-bg-card);
    border: 1px solid var(--yh2ud-border);
    border-radius: var(--yh2ud-radius);
    box-shadow: var(--yh2ud-shadow-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    animation: yh2ud-fadein 0.3s ease;
}

@keyframes yh2ud-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.yh2ud-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--yh2ud-border);
}

.yh2ud-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.yh2ud-callsign-badge {
    background: var(--yh2ud-primary);
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    padding: 0.35rem 0.9rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.yh2ud-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #dcfce7;
    color: #166534;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    border: 1px solid #bbf7d0;
}

.yh2ud-subtext {
    font-size: 0.875rem;
    color: var(--yh2ud-text-muted);
}

/* ==================== DESKTOP TABLE ==================== */
.yh2ud-table-responsive {
    width: 100%;
    overflow-x: auto;
}

.yh2ud-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
    background: #ffffff;
}

.yh2ud-table thead {
    background: #f1f5f9;
}

.yh2ud-table th {
    padding: 1rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    border-bottom: 2px solid var(--yh2ud-border);
}

.yh2ud-table td {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.yh2ud-table tbody tr {
    transition: background-color 0.15s ease;
}

.yh2ud-table tbody tr:hover {
    background-color: #f8fafc;
}

.yh2ud-td-date strong {
    color: #1e293b;
    font-weight: 600;
}

.yh2ud-td-name {
    font-weight: 500;
    color: #334155;
}

.yh2ud-event-text {
    color: #0369a1;
    font-weight: 500;
}

.text-right {
    text-align: right;
}

/* Badges */
.yh2ud-badge {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.yh2ud-badge-primary {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.yh2ud-badge-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.yh2ud-badge-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.yh2ud-badge-info {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.yh2ud-badge-purple {
    background: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}

.yh2ud-badge-default {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Download Button */
.yh2ud-btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #2563eb;
    color: #ffffff !important;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

.yh2ud-btn-download:hover {
    background: #1d4ed8;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

/* ==================== MOBILE CARDS ==================== */
.yh2ud-mobile-cards {
    display: none;
    padding: 1rem;
    gap: 0.75rem;
}

.yh2ud-mobile-card-item {
    background: #ffffff;
    border: 1px solid var(--yh2ud-border);
    border-radius: var(--yh2ud-radius-sm);
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.yh2ud-mc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--yh2ud-border);
}

.yh2ud-mc-date {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1e293b;
}

.yh2ud-mc-name {
    margin: 0 0 0.35rem 0;
    font-size: 1.05rem;
    color: var(--yh2ud-text-main);
}

.yh2ud-mc-event {
    font-size: 0.9rem;
    color: #0369a1;
    margin-bottom: 0.6rem;
}

.yh2ud-mc-footer {
    margin-top: 0.75rem;
}

.yh2ud-btn-download-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem;
    background: var(--yh2ud-primary);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ==================== ALERTS & EMPTY STATE ==================== */
.yh2ud-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem;
    border-radius: var(--yh2ud-radius-sm);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.yh2ud-alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.yh2ud-empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: var(--yh2ud-bg-card);
    border: 1px solid var(--yh2ud-border);
    border-radius: var(--yh2ud-radius);
    box-shadow: var(--yh2ud-shadow);
    margin-bottom: 1.5rem;
}

.yh2ud-empty-icon {
    margin-bottom: 1rem;
}

.yh2ud-empty-state h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.35rem;
    color: #1e293b;
}

.yh2ud-empty-state p {
    font-size: 1rem;
    color: var(--yh2ud-text-muted);
    margin: 0 0 0.75rem 0;
}

.yh2ud-empty-hint {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Footer info */
.yh2ud-footer-info {
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 1rem;
}

/* ==================== RESPONSIVE MEDIA QUERIES ==================== */
@media (max-width: 768px) {
    .yh2ud-table-responsive {
        display: none;
    }
    .yh2ud-mobile-cards {
        display: flex;
        flex-direction: column;
    }
    .yh2ud-search-card {
        padding: 1.5rem 1.2rem;
    }
    .yh2ud-title {
        font-size: 1.4rem;
    }
    .yh2ud-input-group {
        flex-direction: column;
    }
    .yh2ud-btn-submit {
        width: 100%;
    }
    .yh2ud-results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
