﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}
a{
    text-decoration:none;
}
.form-group label{
    font-size:20px;
    font-weight:900;
}
video{
    max-height:400px;
}
.myRow {
    display: flex;
    flex-direction: row;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.form-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

h2 {
    color: #333;
    margin-bottom: 25px;
    text-align: center;
    font-size: 28px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 14px;
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

    input:focus, textarea:focus, select:focus {
        outline: none;
        border-color: #667eea;
    }

.upload-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.image-upload {
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .image-upload:hover {
        background-color: #f8f9ff;
    }

    .image-upload input {
        display: none;
    }

    .image-upload label {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        margin: 0;
    }

    .image-upload i {
        font-size: 40px;
        color: #667eea;
    }

.preview-image {
    max-width: 100px;
    max-height: 100px;
    margin-top: 10px;
    border-radius: 8px;
    border: 2px solid #667eea;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.3s, box-shadow 0.3s;
}

    button:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    }

/* حاوية الفاتورة بحجم A5 بالضبط */
.invoice-preview {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* مقاس A5 بالضبط 148mm × 210mm */
#invoice {
    width: 148mm;
    min-height: 210mm;
    height: auto;
    padding: 8mm;
    background: white;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
    page-break-after: always;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    margin: 0 auto;
    border: 1px solid #e1e1e1;
    position: relative;
    overflow: hidden;
}

/* تنسيق خطوط المسطرة للتأكد من المقاس */
.size-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(102, 126, 234, 0.8);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 8px;
    z-index: 10;
}

/* تنسيقات الفاتورة المحسنة لتناسب A5 */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1.5px solid #667eea;
}

.company-info {
    flex: 1;
}

    .company-info h1 {
        color: #333;
        font-size: 18px;
        margin-bottom: 3px;
        font-weight: bold;
    }

    .company-info p {
        color: #666;
        margin: 2px 0;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 3px;
    }

.logo-section {
    display: flex;
    gap: 5px;
    align-items: center;
}

.company-logo {
    width: 90px;
    height: 90px;
    overflow: hidden;
    /*border-radius: 10%;*/
    /*border: 1.5px solid #667eea;*/
    /*background: #f8f9ff;*/
}

    .company-logo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.invoice-image {
    width: 180px;
    height: 180px;
    overflow: hidden;
    border-radius: 5px;
    border: 1.5px solid #667eea;
}

    .invoice-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.invoice-title {
    text-align: center;
    margin: 5px 0;
}

    .invoice-title h2 {
        color: #667eea;
        font-size: 14px;
        border: none;
        margin: 0;
        padding: 0;
        font-weight: bold;
    }

.customer-section {
    background: #f8f9ff;
    padding: 6px;
    border-radius: 5px;
    margin-bottom: 8px;
}

    .customer-section h3 {
        color: #333;
        margin-bottom: 4px;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 3px;
    }

.customer-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
}

.detail-item {
    margin-bottom: 3px;
}

    .detail-item label {
        color: #667eea;
        font-size: 10px;
        margin-bottom: 1px;
        font-weight: 600;
    }

    .detail-item p {
        color: #333;
        font-size: 12px;
        font-weight: 600;
        padding: 3px;
        background: white;
        border-radius: 3px;
        border: 1px solid #e1e1e1;
    }

.items-table {
    margin: 8px 0px 8px 10px;
    overflow-x: auto;
    min-width: 300px;
}

    .items-table table {
        width: 100%;
        border-collapse: collapse;
        background: white;
        border-radius: 5px;
        overflow: hidden;
        font-size: 14px;
    }

    .items-table th {
        background: #667eea;
        color: white;
        padding: 4px;
        font-size: 14px;
        font-weight: 600;
    }

    .items-table td {
        padding: 3px;
        border-bottom: 1px solid #e1e1e1;
        text-align: center;
        font-size: 14px;
    }

.total-section {
    background: #f8f9ff;
    padding: 6px;
    border-radius: 5px;
    margin-top: 8px;
}

.border-class {
    border-radius: 5px;
    border: #667eea solid 2px;
    min-height: 100px;
    width: 100%;
}

.total-row {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-bottom: 3px;
    font-size: 9px;
}

.grand-total {
    font-size: 11px;
    color: #667eea;
    border-top: 1.5px solid #667eea;
    padding-top: 3px;
    margin-top: 3px;
    font-weight: bold;
}

.invoice-footer {
    margin-top: 8px;
    padding: 5px;
    background: #f8f9ff;
    border-radius: 5px;
    text-align: center;
    font-size: 7px;
}

.signature-section {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 5px;
    border-top: 1px dashed #ccc;
    font-size: 7px;
}

.signature {
    text-align: center;
    width: 80px;
}

.signature-line {
    margin-top: 15px;
    border-top: 1px solid #333;
    padding-top: 2px;
}

/* تنسيقات الطباعة بحجم A5 */
@media print {
    @page {
        size: A5;
        margin: 0;

    }

    body * {
        visibility: hidden;
    }

    #invoice, #invoice * {
        visibility: visible;
    }

    #invoice {
        position: absolute;
        left: 0;
        top: 0;
        width: 148mm;
        height: 210mm;
        margin: 0;
        padding: 8mm;
        box-shadow: none;
        border: none;
    }

    .no-print {
        display: none !important;
    }

    .size-indicator {
        display: none;
    }
}

.no-print {
    margin-top: 20px;
    text-align: center;
}

.print-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    width: auto;
    padding: 10px 25px;
    margin: 0 5px;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.invoice-note {
    text-align:center;
    font-size:10px;
    font-weight:600;
}
/* تلميح المقاس */
.size-hint {
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 12px;
    color: #666;
}