/* Random Year Generator v1.0.0 — style.css
   Scoped under .ryg-wrap to avoid WordPress theme conflicts. */

.ryg-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #111827;
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
}

.ryg-wrap * {
    box-sizing: border-box;
}

/* Two-column grid layout */
.ryg-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Cards */
.ryg-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
}

/* Input rows */
.ryg-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.ryg-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.ryg-lbl {
    font-size: .8rem;
    font-weight: 600;
    color: #374151;
    display: block;
}

.ryg-inp,
.ryg-sel {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .95rem;
    color: #111827;
    font-family: inherit;
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
}

.ryg-inp:focus,
.ryg-sel:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}

.ryg-sel {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Toggle switch */
.ryg-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    user-select: none;
    cursor: pointer;
}

.ryg-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.ryg-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.ryg-slider {
    position: absolute;
    inset: 0;
    background: #D1D5DB;
    border-radius: 100px;
    transition: background .2s;
    cursor: pointer;
}

.ryg-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.ryg-toggle input:checked + .ryg-slider {
    background: #3B82F6;
}

.ryg-toggle input:checked + .ryg-slider::before {
    transform: translateX(20px);
}

.ryg-toggle-lbl {
    font-size: .9rem;
    color: #374151;
    font-weight: 500;
}

/* Generate button */
.ryg-btn-generate {
    display: block;
    width: 100%;
    padding: 13px;
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, transform .1s;
    letter-spacing: .01em;
}

.ryg-btn-generate:hover { background: #2563EB; }
.ryg-btn-generate:active { transform: scale(.98); }

/* Error message */
.ryg-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 6px;
    color: #B91C1C;
    font-size: .82rem;
    font-weight: 600;
    padding: 9px 13px;
    margin-top: 12px;
    display: none;
}

/* Results panel */
.ryg-res-head {
    font-size: .78rem;
    font-weight: 700;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin: 0 0 10px;
    padding: 0;
}

.ryg-output-box {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    min-height: 160px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    overflow-y: auto;
    max-height: 360px;
}

.ryg-placeholder {
    color: #9CA3AF;
    font-size: .9rem;
    text-align: center;
    font-style: italic;
}

/* Year list */
.ryg-year-list {
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-self: flex-start;
}

.ryg-year-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 9px 13px;
    transition: border-color .15s;
}

.ryg-year-item:hover { border-color: #93C5FD; }

.ryg-year-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1D4ED8;
    font-variant-numeric: tabular-nums;
}

.ryg-year-cp {
    background: none;
    border: none;
    cursor: pointer;
    color: #9CA3AF;
    font-size: .78rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    transition: color .15s, background .15s;
    font-family: inherit;
}

.ryg-year-cp:hover   { color: #3B82F6; background: #EFF6FF; }
.ryg-year-cp.ryg-done { color: #059669; }

/* Copy / Download buttons */
.ryg-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ryg-btn-action {
    padding: 10px;
    background: #fff;
    color: #374151;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: .88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
    text-align: center;
}

.ryg-btn-action:hover {
    border-color: #3B82F6;
    color: #3B82F6;
    background: #EFF6FF;
}

/* Responsive — stack panels at ≤ 768px */
@media (max-width: 768px) {
    .ryg-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .ryg-row    { grid-template-columns: 1fr; }
    .ryg-actions { grid-template-columns: 1fr; }
}
