/**
 * Frontend Styles for WP E-Piagam Penghargaan
 * Scoped under .wp-piagam-container to avoid conflict with WP themes
 */

.wp-piagam-container {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
    box-sizing: border-box;
    color: #1f2937;
}

.wp-piagam-container *,
.wp-piagam-container *::before,
.wp-piagam-container *::after {
    box-sizing: border-box;
}

/* Card Box */
.wp-piagam-card {
    background: #1c1917;
    color: #f5f5f4;
    border: 1px solid #44403c;
    border-radius: 1.5rem;
    padding: 2.25rem 1.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    text-align: center;
    margin-bottom: 2rem;
}

.wp-piagam-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.wp-piagam-title {
    font-size: 1.875rem;
    font-weight: 900;
    line-height: 1.2;
    color: #ffffff !important;
    text-transform: uppercase;
    letter-spacing: -0.025em;
    margin: 0 0 0.75rem 0;
}

.wp-piagam-subtitle {
    font-size: 0.925rem;
    color: #d6d3d1;
    max-width: 550px;
    margin: 0 auto 1.75rem auto;
    line-height: 1.5;
}

/* Search Form */
.wp-piagam-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.wp-piagam-search-box {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: #0c0a09;
    padding: 0.6rem;
    border-radius: 1rem;
    border: 2px solid #57534e;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wp-piagam-search-box:focus-within {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

@media (min-width: 640px) {
    .wp-piagam-search-box {
        flex-direction: row;
        align-items: center;
    }
}

.wp-piagam-input-group {
    display: flex;
    align-items: center;
    flex-grow: 1;
    padding-left: 0.75rem;
}

.wp-piagam-input-icon {
    color: #a8a29e;
    font-size: 1.1rem;
    margin-right: 0.65rem;
}

.wp-piagam-input {
    width: 100%;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #ffffff !important;
    font-family: 'Share Tech Mono', monospace, Consolas, sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.15rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    padding: 0.5rem 0 !important;
    box-shadow: none !important;
}

.wp-piagam-input::placeholder {
    color: #78716c !important;
    font-size: 0.95rem;
    letter-spacing: normal;
}

.wp-piagam-btn-submit {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #1c1917 !important;
    font-weight: 800 !important;
    font-size: 0.9rem !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 0.75rem !important;
    border: none !important;
    cursor: pointer !important;
    transition: transform 0.15s ease, opacity 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    text-decoration: none !important;
    flex-shrink: 0 !important;
}

.wp-piagam-btn-submit:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    transform: translateY(-1px);
    opacity: 0.95;
}

/* Results section */
.wp-piagam-results-count {
    color: #10b981;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.wp-piagam-item-card {
    background: #292524;
    border: 1px solid #44403c;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    color: #f5f5f4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wp-piagam-item-card:hover {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.wp-piagam-item-header {
    border-bottom: 1px solid #44403c;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .wp-piagam-item-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.wp-piagam-nomor-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-family: monospace;
    font-weight: 600;
    color: #34d399;
    background: rgba(6, 78, 59, 0.7);
    border: 1px solid rgba(52, 211, 153, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.4rem;
}

.wp-piagam-item-callsign {
    font-size: 1.75rem;
    font-weight: 900;
    color: #f59e0b;
    letter-spacing: 0.05em;
    line-height: 1.1;
}

.wp-piagam-item-nama {
    font-size: 0.95rem;
    color: #e7e5e4;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.wp-piagam-item-detail {
    margin-bottom: 1.25rem;
}

.wp-piagam-juara-label {
    display: inline-block;
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 0.25rem 0.65rem;
    border-radius: 0.5rem;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.wp-piagam-lomba-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.4;
}

.wp-piagam-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.wp-piagam-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    padding: 0.6rem 1rem !important;
    border-radius: 0.65rem !important;
    font-size: 0.825rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    border: 1px solid transparent !important;
}

.wp-piagam-btn-preview {
    background: #047857 !important;
    color: #ffffff !important;
}
.wp-piagam-btn-preview:hover {
    background: #059669 !important;
}

.wp-piagam-btn-jpg {
    background: #2563eb !important;
    color: #ffffff !important;
}
.wp-piagam-btn-jpg:hover {
    background: #1d4ed8 !important;
}

.wp-piagam-btn-pdf {
    background: #dc2626 !important;
    color: #ffffff !important;
}
.wp-piagam-btn-pdf:hover {
    background: #b91c1c !important;
}

/* Alert Not Found */
.wp-piagam-notfound {
    background: rgba(136, 19, 55, 0.3);
    border: 1px solid rgba(244, 63, 94, 0.4);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    color: #fecdd3;
}
.wp-piagam-notfound h4 {
    color: #fda4af;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

/* Lightbox Modal */
.wp-piagam-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(4px);
    overflow: auto;
    padding: 1.5rem 1rem;
    align-items: center;
    justify-content: center;
}

.wp-piagam-modal.active {
    display: flex;
}

.wp-piagam-modal-content {
    background: #1c1917;
    border: 1px solid #44403c;
    border-radius: 1rem;
    max-width: 900px;
    width: 100%;
    padding: 1rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.wp-piagam-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    color: #a8a29e;
    background: #292524;
    border: 1px solid #57534e;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}
.wp-piagam-modal-close:hover {
    color: #ffffff;
    background: #44403c;
}

.wp-piagam-modal-img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    display: block;
}

.wp-piagam-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #292524;
}
