/**
 * VH License Manager Pro - Admin Styles
 * 
 * Red wine themed admin interface with smooth animations
 * and responsive design for license key management.
 * 
 * @package VH_License_Manager
 */

/* =========================
   BASE STYLES
   ========================= */
.vd-title {
    color: #7A001F;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #7A001F;
}

.vd-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.vd-box:hover {
    box-shadow: 0 4px 12px rgba(122, 0, 31, 0.1);
}

.vd-box h2 {
    background: #7A001F;
    color: #fff;
    margin: 0;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vd-h2-ico {
    font-size: 20px;
}

.vd-box-content {
    padding: 24px;
    display: block;
}

.vd-box.collapsed .vd-box-content {
    display: none;
}

/* =========================
   BUTTON STYLES
   ========================= */
.vd-btn-red {
    background: #7A001F;
    border-color: #7A001F;
    color: #fff;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.vd-btn-red:hover,
.vd-btn-red:focus {
    background: #5a0017;
    border-color: #5a0017;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(122, 0, 31, 0.3);
}

.vd-btn-red-outline {
    background: transparent;
    border: 2px solid #7A001F;
    color: #7A001F;
    border-radius: 8px;
    padding: 6px 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.vd-btn-red-outline:hover,
.vd-btn-red-outline:focus {
    background: #7A001F;
    color: #fff;
    transform: translateY(-1px);
}

/* =========================
   TABLE STYLES
   ========================= */
.vd-table {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.vd-table th {
    background: #f8f9fa;
    color: #7A001F;
    font-weight: 600;
    padding: 12px;
    border-bottom: 2px solid #7A001F;
}

.vd-table td {
    padding: 12px;
    vertical-align: middle;
}

.vd-table.striped tbody tr:nth-child(odd) {
    background: #fafafa;
}

.vd-table.striped tbody tr:hover {
    background: #fff5f7;
}

/* Mini table for compact displays */
.vd-mini-table {
    width: 100%;
    border-collapse: collapse;
}

.vd-mini-table th,
.vd-mini-table td {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.vd-mini-table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* =========================
   BADGE STYLES
   ========================= */
.vd-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.vd-badge.vd-used {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* =========================
   FORM STYLES
   ========================= */
.vd-form {
    max-width: 100%;
}

.vd-form-table {
    width: 100%;
}

.vd-form-table th {
    width: 200px;
    padding: 15px 10px 15px 0;
    font-weight: 600;
    vertical-align: top;
}

.vd-form-table td {
    padding: 10px 0;
}

.vd-form input[type="text"],
.vd-form input[type="email"],
.vd-form input[type="url"],
.vd-form input[type="number"],
.vd-form select,
.vd-form textarea {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.vd-form input:focus,
.vd-form select:focus,
.vd-form textarea:focus {
    border-color: #7A001F;
    outline: none;
    box-shadow: 0 0 0 3px rgba(122, 0, 31, 0.1);
}

.vd-form textarea {
    min-height: 120px;
    resize: vertical;
}

.vd-hint {
    color: #6b7280;
    font-size: 13px;
    margin-top: 6px;
    font-style: italic;
}

/* =========================
   CODE & PRE STYLES
   ========================= */
.vd-pre {
    background: #1f2937;
    color: #f3f4f6;
    padding: 16px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: auto;
    margin: 10px 0;
    border: 1px solid #374151;
}

code {
    background: #f3f4f6;
    color: #7A001F;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    border: 1px solid #e5e7eb;
}

/* =========================
   PAGINATION STYLES
   ========================= */
.vd-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.vd-perpage-bar {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vd-perpage-form {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vd-perpage-form label {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vd-perpage-form select {
    width: auto;
    max-width: 80px;
}

/* =========================
   SEARCH BOX STYLES
   ========================= */
.vhm-search-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.vhm-search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

#vhm-search-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

#vhm-search-input:focus {
    border-color: #7A001F;
    outline: none;
    box-shadow: 0 0 0 3px rgba(122, 0, 31, 0.1);
}

.vhm-search-stats {
    font-size: 14px;
    color: #6b7280;
}

/* =========================
   LOADING INDICATOR
   ========================= */
#vhm-loading {
    text-align: center;
    padding: 40px 20px;
}

.vhm-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #7A001F;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: vhm-spin 2s linear infinite;
    margin: 0 auto 15px auto;
}

@keyframes vhm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================
   ACTION BUTTONS
   ========================= */
.vd-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.vd-actions .button {
    margin: 2px;
    font-size: 12px;
    padding: 4px 8px;
    min-height: auto;
}

.vd-actions-bar {
    display: flex;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 10px;
}

/* =========================
   LICENSE BOXES
   ========================= */
.vd-license-box {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin: 15px 0;
}

.vd-license-box h3 {
    margin: 0 0 12px 0;
    color: #7A001F;
    font-size: 16px;
}

.vd-inline-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 15px 0;
    padding: 12px;
    background: #f0f9ff;
    border-radius: 8px;
    border-left: 4px solid #7A001F;
}

.vd-inline-hint {
    color: #6b7280;
    font-size: 13px;
    font-style: italic;
}

/* =========================
   FRONTEND STYLES
   ========================= */
.vd-front-box {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.vd-front-box h3 {
    color: #7A001F;
    margin-top: 0;
    border-bottom: 2px solid #7A001F;
    padding-bottom: 10px;
}

.vhm-rules {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin: 15px 0;
}

.vhm-rules strong {
    color: #7A001F;
    display: block;
    margin-bottom: 8px;
}

.vhm-rules ul {
    margin: 0;
    padding-left: 20px;
}

.vhm-rules li {
    margin-bottom: 4px;
    color: #6b7280;
}

/* =========================
   SWEETALERT2 CUSTOMIZATION
   ========================= */
.vd-swal {
    border-radius: 12px !important;
}

.vd-swal-confirm {
    background: #7A001F !important;
    border-color: #7A001F !important;
}

.vd-swal-cancel {
    background: #6b7280 !important;
    border-color: #6b7280 !important;
}

/* =========================
   RESPONSIVE DESIGN
   ========================= */
@media (max-width: 768px) {
    .vd-box-content {
        padding: 16px;
    }
    
    .vd-table {
        font-size: 13px;
    }
    
    .vd-table th,
    .vd-table td {
        padding: 8px;
    }
    
    .vd-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .vd-actions .button {
        width: 100%;
        text-align: center;
    }
    
    .vhm-search-form {
        flex-direction: column;
        gap: 8px;
    }
    
    #vhm-search-input {
        width: 100%;
    }
    
    .vd-pagination {
        justify-content: center;
    }
    
    .vd-perpage-bar {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .vd-inline-strip {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .vd-title {
        font-size: 24px;
    }
    
    .vd-box h2 {
        padding: 12px 16px;
        font-size: 16px;
    }
    
    .vd-form-table th,
    .vd-form-table td {
        display: block;
        width: 100%;
        padding: 8px 0;
    }
    
    .vd-form-table th {
        padding-bottom: 4px;
    }
}

/* =========================
   UTILITY CLASSES
   ========================= */
.vd-link {
    color: #7A001F;
    text-decoration: none;
    font-weight: 500;
}

.vd-link:hover {
    color: #5a0017;
    text-decoration: underline;
}

.vd-text-center {
    text-align: center;
}

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

.vd-mt-10 {
    margin-top: 10px;
}

.vd-mb-10 {
    margin-bottom: 10px;
}

.vd-mt-20 {
    margin-top: 20px;
}

.vd-mb-20 {
    margin-bottom: 20px;
}

/* =========================
   PRINT STYLES
   ========================= */
@media print {
    .vd-btn-red,
    .vd-btn-red-outline,
    .vd-actions,
    .vd-pagination,
    .vhm-search-box {
        display: none !important;
    }
    
    .vd-box {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .vd-table {
        border: 1px solid #000;
    }
}