/**
 * Dokan Contract Manager - Frontend Styles
 * Tüm stiller .dcm-* prefix ile scope'lanmıştır
 */

/* ==========================================================================
   GENEL RESET & BASE
   ========================================================================== */
.dcm-contracts-wrapper,
.dcm-checkout-contracts,
.dcm-order-contract-links,
.dcm-contracts-page {
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.6;
}

.dcm-contracts-wrapper *,
.dcm-checkout-contracts *,
.dcm-order-contract-links *,
.dcm-contracts-page * {
    box-sizing: border-box;
}

/* ==========================================================================
   KAYIT FORMU SÖZLEŞMELERİ
   ========================================================================== */
.dcm-contracts-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
}

.dcm-contracts-title {
    margin: 0 0 15px 0;
    padding: 0 0 10px 0;
    border-bottom: 2px solid #1976d2;
    color: #1976d2;
    font-size: 18px;
    font-weight: 600;
}

.dcm-existing-user-notice {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #e3f2fd;
    border-radius: 4px;
    color: #1565c0;
    font-size: 14px;
}

.dcm-contracts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dcm-contract-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    transition: border-color 0.2s ease;
}

.dcm-contract-item:hover {
    border-color: #1976d2;
}

.dcm-contract-item.dcm-hidden {
    display: none !important;
}

/* Checkbox Label */
.dcm-checkbox-label,
.dcm-contract-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

/* Checkbox - Tema override'larını kır */
.dcm-checkbox-label input[type="checkbox"],
.dcm-contract-checkbox-wrapper input[type="checkbox"],
.dcm-contract-checkbox,
.dcm-checkout-checkbox,
input.dcm-contract-checkbox,
input.dcm-checkout-checkbox {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    margin: 3px 0 0 0 !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    z-index: 10 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
    transform: none !important;
    clip: auto !important;
    clip-path: none !important;
    display: inline-block !important;
}

.dcm-checkbox-label input[type="checkbox"]:checked,
.dcm-contract-checkbox-wrapper input[type="checkbox"]:checked {
    accent-color: #1976d2;
}

/* Label içindeki pseudo elementleri devre dışı bırak */
.dcm-checkbox-label::before,
.dcm-checkbox-label::after,
.dcm-contract-checkbox-wrapper::before,
.dcm-contract-checkbox-wrapper::after {
    display: none !important;
    content: none !important;
}

.dcm-contract-text {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.dcm-contract-link {
    color: #1976d2;
    text-decoration: underline;
    font-weight: 500;
}

.dcm-contract-link:hover {
    color: #1565c0;
    text-decoration: none;
}

.dcm-required-star {
    color: #dc3545;
    margin-left: 2px;
}

.dcm-contract-version {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: #999;
}

/* ==========================================================================
   CHECKOUT SÖZLEŞMELERİ
   ========================================================================== */
.dcm-checkout-contracts {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
}

.dcm-checkout-contracts h3 {
    margin: 0 0 15px 0;
    padding: 0 0 10px 0;
    border-bottom: 2px solid #1976d2;
    color: #1976d2;
    font-size: 18px;
    font-weight: 600;
}

.dcm-multi-vendor-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.dcm-multi-vendor-notice p {
    margin: 0;
    color: #856404;
    font-size: 14px;
}

.dcm-multi-vendor-notice .dashicons {
    margin-right: 5px;
    vertical-align: middle;
}

.dcm-vendor-contracts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dcm-vendor-contract-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    transition: border-color 0.2s ease;
}

.dcm-vendor-contract-box:hover {
    border-color: #1976d2;
}

.dcm-vendor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dcm-vendor-header h4 {
    margin: 0;
    color: #333;
    font-size: 15px;
    font-weight: 600;
}

.dcm-vendor-header h4 .dashicons {
    margin-right: 5px;
    color: #1976d2;
    vertical-align: middle;
}

.dcm-vendor-header small {
    color: #666;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.dcm-vendor-products {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.dcm-vendor-products ul {
    margin: 0;
    padding-left: 20px;
}

.dcm-vendor-products li {
    color: #666;
    font-size: 13px;
    margin-bottom: 3px;
}

.dcm-toggle-products {
    font-size: 12px;
    padding: 4px 12px;
    margin-bottom: 12px;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dcm-toggle-products:hover {
    background: #dee2e6;
}

.dcm-checkout-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.dcm-checkout-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.dcm-checkout-checkbox-label input[type="checkbox"]:checked {
    accent-color: #1976d2;
}

.dcm-contract-text {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.dcm-checkout-notice {
    margin-top: 15px;
    padding: 12px 15px;
    background: #e3f2fd;
    border-radius: 4px;
}

.dcm-checkout-notice p {
    margin: 0;
    color: #1565c0;
    font-size: 13px;
}

.dcm-checkout-notice .dashicons {
    margin-right: 5px;
    vertical-align: middle;
}

/* ==========================================================================
   SİPARİŞ DETAY SÖZLEŞME LİNKLERİ
   ========================================================================== */
.dcm-order-contract-links {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
}

.dcm-order-contract-links h3 {
    margin: 0 0 15px 0;
    color: #1976d2;
    font-size: 18px;
    font-weight: 600;
}

.dcm-contract-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dcm-vendor-contracts {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
}

.dcm-vendor-contracts h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.dcm-contract-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 10px;
    margin-bottom: 5px;
    padding: 8px 15px;
    background: #1976d2;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dcm-contract-pdf-btn:hover {
    background: #1565c0;
    color: #fff !important;
}

.dcm-contract-pdf-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   SÖZLEŞMELERİM SAYFASI (SHORTCODE)
   ========================================================================== */
.dcm-contracts-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.dcm-contracts-page h2 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.dcm-contracts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.dcm-contract-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.dcm-contract-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dcm-contract-card.approved {
    border-color: #28a745;
    background: linear-gradient(to bottom, #f8fff8, #fff);
}

.dcm-contract-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #999;
}

.dcm-contract-card.approved .dcm-contract-icon {
    background: #d4edda;
    color: #28a745;
}

.dcm-contract-card h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #333;
    font-weight: 600;
}

.dcm-contract-status {
    margin: 0 0 15px 0;
    font-size: 13px;
    color: #666;
}

.dcm-contract-card.approved .dcm-contract-status {
    color: #28a745;
    font-weight: 500;
}

.dcm-contract-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dcm-contract-actions .button {
    padding: 8px 15px;
    font-size: 13px;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Onay Geçmişi Tablosu */
.dcm-approval-history {
    margin-top: 40px;
}

.dcm-approval-history h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

/* ==========================================================================
   SÖZLEŞME İÇERİK STİLLERİ (HTML şablonları için)
   ========================================================================== */
.dcm-contract-document {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
}

.dcm-contract-document h1 {
    text-align: center;
    font-size: 22px;
    color: #1976d2;
    margin: 0 0 10px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #1976d2;
}

.dcm-contract-document h2 {
    font-size: 16px;
    color: #333;
    margin: 25px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #e1e5e9;
}

.dcm-contract-document h3 {
    font-size: 14px;
    color: #555;
    margin: 20px 0 8px 0;
}

.dcm-contract-document p {
    margin: 0 0 12px 0;
    text-align: justify;
}

.dcm-contract-document ul,
.dcm-contract-document ol {
    margin: 0 0 15px 0;
    padding-left: 25px;
}

.dcm-contract-document li {
    margin-bottom: 5px;
}

/* Bilgi Tablosu */
.dcm-info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 13px;
}

.dcm-info-table th,
.dcm-info-table td {
    padding: 10px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.dcm-info-table th {
    background: #f8f9fa;
    font-weight: 600;
    width: 35%;
    color: #555;
}

.dcm-info-table td {
    background: #fff;
}

/* Meta Bilgiler (Sözleşme No, Tarih vb.) */
.dcm-contract-meta {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
    font-size: 12px;
    color: #666;
}

.dcm-contract-meta p {
    margin: 5px 0;
    text-align: left;
}

.dcm-contract-meta strong {
    color: #333;
}

/* İmza Bölümü */
.dcm-signature-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.dcm-signature-row {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-top: 30px;
}

.dcm-signature-box {
    flex: 1;
    text-align: center;
    padding: 20px;
    border: 1px dashed #ccc;
    border-radius: 6px;
}

.dcm-signature-box p {
    margin: 0;
    text-align: center;
}

.dcm-signature-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.dcm-signature-name {
    font-size: 13px;
    color: #666;
    margin-top: 30px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .dcm-contracts-wrapper,
    .dcm-checkout-contracts,
    .dcm-order-contract-links {
        padding: 15px;
        margin: 15px 0;
    }
    
    .dcm-vendor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .dcm-contracts-grid {
        grid-template-columns: 1fr;
    }
    
    .dcm-signature-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .dcm-contract-document {
        padding: 15px;
    }
    
    .dcm-info-table th {
        width: 40%;
    }
}

@media (max-width: 480px) {
    .dcm-contract-actions {
        flex-direction: column;
    }
    
    .dcm-contract-actions .button {
        width: 100%;
        text-align: center;
    }
    
    .dcm-contract-pdf-btn {
        width: 100%;
        justify-content: center;
        margin-right: 0;
    }
}
