/* Print styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .print-section, .print-section * {
        visibility: visible;
    }
    
    .print-section {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 210mm; /* A4 width */
        max-height: 297mm; /* A4 height */
        background: white;
        padding: 15px;
        box-shadow: none;
        font-size: 11px; /* Daha küçük font boyutu */
        line-height: 1.3;
        page-break-inside: avoid; /* Sayfa içinde bölünmeyi önle */
    }
    
    /* Hide navigation and other UI elements during print */
    .sidebar,
    .topbar,
    .navbar,
    .btn,
    .card-header,
    .alert,
    .modal,
    .toast,
    .dropdown,
    .breadcrumb,
    footer,
    header,
    nav,
    .content > .row:not(:first-child) {
        display: none !important;
    }
    
    /* Ensure ticket content is properly displayed */
    .service-ticket {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border: none;
        font-size: 11px;
        page-break-inside: avoid;
    }
    
    /* Optimize ticket layout for printing */
    .ticket-header h3 {
        font-size: 16px;
        margin-bottom: 5px;
        page-break-after: avoid;
    }
    
    .ticket-header p {
        font-size: 10px;
        margin: 2px 0;
        page-break-after: avoid;
    }
    
    .ticket-info,
    .customer-info,
    .bike-info,
    .service-info {
        margin-bottom: 12px;
        page-break-inside: avoid;
    }
    
    .ticket-info h5,
    .customer-info h5,
    .bike-info h5,
    .service-info h5 {
        font-size: 12px;
        margin-bottom: 6px;
        border-bottom: 1px solid #ddd;
        padding-bottom: 2px;
        page-break-after: avoid;
    }
    
    .ticket-info p,
    .customer-info p,
    .bike-info p,
    .service-info p {
        margin: 3px 0;
        font-size: 10px;
        line-height: 1.2;
        page-break-after: avoid;
    }
    
    .ticket-footer {
        margin-top: 15px;
        page-break-inside: avoid;
    }
    
    .ticket-footer hr {
        margin: 8px 0;
        page-break-after: avoid;
    }
    
    .ticket-footer p {
        margin: 4px 0;
        font-size: 9px;
        page-break-after: avoid;
    }
    
    /* Adjust table styles if any */
    table {
        font-size: 9px;
        page-break-inside: auto;
    }
    
    th, td {
        padding: 1px;
        page-break-inside: avoid;
    }
    
    /* Sayfa sınırlarını ayarla */
    @page {
        size: A4;
        margin: 0.5cm;
    }
}

/* Improved print styles */
@media print {
    body * {
        visibility: hidden;
    }
    
    .print-content, .print-content * {
        visibility: visible;
    }
    
    .print-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 210mm;
        background: white;
        padding: 15px;
        font-size: 11px;
        line-height: 1.3;
    }
    
    .print-content * {
        visibility: visible !important;
    }
    
    .print-content table {
        width: 100%;
        border-collapse: collapse;
        margin: 10px 0;
    }
    
    .print-content th,
    .print-content td {
        border: 1px solid #000;
        padding: 5px;
        text-align: left;
        font-size: 10px;
    }
    
    .print-content h1, .print-content h2, .print-content h3, .print-content h4, .print-content h5, .print-content h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }
    
    .print-content img {
        max-width: 100%;
        height: auto;
    }
    
    @page {
        margin: 1cm;
        size: A4;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .admin-container {
        padding: 10px;
    }
    
    .admin-card {
        margin: 10px 0;
    }
    
    .form-container {
        padding: 15px;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .btn {
        margin: 2px;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success animation */
.success-checkmark {
    width: 80px;
    height: 115px;
    margin: 0 auto;
}

.success-checkmark .check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #4CAF50;
}

.success-checkmark .check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.success-checkmark .check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

.success-checkmark .check-icon::before, .success-checkmark .check-icon::after {
    content: "";
    height: 100px;
    position: absolute;
    background: #FFFFFF;
    transform: rotate(0deg);
}

.success-checkmark .check-icon .icon-line {
    height: 5px;
    background-color: #4CAF50;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.success-checkmark .check-icon .icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s ease-in;
}

.success-checkmark .check-icon .icon-line.line-long {
    top: 38px;
    right: 14px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s ease-in;
}

@keyframes rotate-circle {
    0% {
        transform: rotate(-45deg);
    }
    5% {
        transform: rotate(-45deg);
    }
    12% {
        transform: rotate(-405deg);
    }
    100% {
        transform: rotate(-405deg);
    }
}

@keyframes icon-line-tip {
    0% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    54% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    70% {
        width: 50px;
        left: -8px;
        top: 37px;
    }
    84% {
        width: 17px;
        left: 21px;
        top: 48px;
    }
    100% {
        width: 25px;
        left: 14px;
        top: 45px;
    }
}

@keyframes icon-line-long {
    0% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    65% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    84% {
        width: 55px;
        right: 0px;
        top: 35px;
    }
    100% {
        width: 47px;
        right: 8px;
        top: 38px;
    }
}