/* style.css */
* {
    box-sizing: border-box;
}

/* Button styles */
.btn {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    min-width: 200px;
}

.btn:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,123,255,0.4);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0,123,255,0.3);
}

/* Mobile responsive button */
@media (max-width: 768px) {
    .btn {
        padding: 14px 20px;
        font-size: 16px;
        min-width: 180px;
        width: 100%;
        max-width: 300px;
        margin: 10px auto;
        display: block;
    }
}

/* Error page styles */
.error-message {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 50px auto;
    max-width: 500px;
}

.error-message h1 {
    color: #dc3545;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.error-message p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
    line-height: 1.6;
}

/* Search button styles */
.search-button-container {
    position: static;
    text-align: center;
    margin: 20px auto;
    z-index: 1000;
}

.search-button {
    background: #007bff;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
    display: inline-block;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,123,255,0.4);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    margin: 0;
    padding: 20px;
    color: #333;
    min-height: 100vh;
}

.container, #order-summary {
    background-color: #fff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    max-width: 600px;
    margin: 20px auto;
    text-align: center;
    border: 1px solid #000000;
}

h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 25px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h2 {
    color: #555;
    font-size: 22px;
    margin-bottom: 20px;
    font-weight: 600;
}

input[type="text"], input[type="email"], input[type="password"], input[type="tel"] {
    width: 100%;
    padding: 15px 20px;
    margin: 15px 0;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    box-sizing: border-box;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="tel"]:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin: 15px 5px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#warning-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 20px;
    font-weight: 600;
    padding: 15px;
    background: #fdf2f2;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
}

#serial-number {
    font-weight: bold;
    color: #e74c3c;
    font-size: 18px;
}

.important {
    color: #e74c3c;
    font-weight: bold;
}

.bold {
    font-weight: 600;
}

.email-info, .email-prompt {
    color: #e74c3c;
    font-weight: 600;
    font-size: 14px;
}

/* Status badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Code display */
.code-display {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #e74c3c;
    font-size: 20px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #e1e5e9;
}

/* Service status */
.service-status {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-weight: 600;
    border-left: 4px solid #28a745;
    background: #f8f9fa;
}

.service-status.error {
    border-left-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.service-status.unknown {
    border-left-color: #ffc107;
    background: #fff3cd;
    color: #856404;
}

/* Success/Error messages */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #28a745;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #dc3545;
}

.waiting-message {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #ffc107;
}

/* Contact info */
.contact-info {
    color: #6c757d;
    margin-top: 25px;
    font-size: 14px;
}

.contact-info a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #6c757d;
    font-size: 14px;
}

/* Links */
a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Form improvements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .search-button-container {
        position: static;
        text-align: center;
        margin: 15px auto;
        z-index: 1001;
    }

    .search-button {
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 6px;
    }

    .container, #order-summary {
        padding: 20px;
        margin: 10px auto;
        border-radius: 12px;
        margin-top: 60px; /* Dodaj margines żeby nie zasłaniał treści */
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    input[type="text"], input[type="email"], input[type="password"], input[type="tel"] {
        font-size: 16px;
        padding: 12px 15px;
    }

    button {
        font-size: 14px;
        padding: 12px 20px;
        margin: 10px 2px;
    }

    #warning-message {
        font-size: 13px;
        padding: 12px;
    }

    .code-display {
        font-size: 18px;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .search-button-container {
        position: static;
        text-align: center;
        margin: 10px auto;
    }

    .search-button {
        padding: 8px 12px;
        font-size: 12px;
    }

    .container, #order-summary {
        padding: 15px;
        margin: 5px auto;
        margin-top: 50px; /* Dodaj margines żeby nie zasłaniał treści */
    }

    h1 {
        font-size: 20px;
    }

    input[type="text"], input[type="email"], input[type="password"], input[type="tel"] {
        font-size: 14px;
        padding: 10px 12px;
    }

    button {
        font-size: 12px;
        padding: 10px 15px;
        margin: 8px 1px;
    }

    #warning-message {
        font-size: 12px;
        padding: 10px;
    }
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.container, #order-summary {
    animation: fadeIn 0.6s ease-out;
}

/* Focus improvements for accessibility */
button:focus, input:focus, a:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Table responsiveness */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 12px 12px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
    min-width: 80px;
}

table td {
    padding: 12px 12px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
    word-break: break-word;
    white-space: nowrap;
    min-width: 80px;
}

table tr:hover {
    background-color: #f8f9fa;
}

/* Specjalne style dla lepszej czytelności */
table td.code-display {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #dc3545;
    background: #f8f9fa;
    text-align: center;
    min-width: 120px;
}

table td.status-badge {
    text-align: center;
    min-width: 100px;
}

table td.actions {
    text-align: center;
    min-width: 150px;
}

table td.email {
    min-width: 200px;
    word-break: break-all;
}

table td.serial {
    font-family: 'Courier New', monospace;
    min-width: 140px;
}

/* Mobile table improvements */
@media (max-width: 768px) {
    .table-container {
        margin: 10px -10px;
        border-radius: 0;
    }
    
    table {
        font-size: 12px;
        min-width: 1000px;
    }
    
    table th,
    table td {
        padding: 10px 8px;
    }
    
    /* Hide less important columns on mobile */
    .hide-mobile {
        display: none;
    }
    
    /* Show important columns on mobile */
    .show-mobile {
        display: table-cell;
    }
}

@media (max-width: 480px) {
    table {
        font-size: 11px;
        min-width: 800px;
    }
    
    table th,
    table td {
        padding: 8px 6px;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .container, #order-summary {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .table-container {
        overflow: visible;
    }
    
    table {
        min-width: auto;
    }
}

/* Date filter styles */
.date-filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.date-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    margin-right: 10px;
}

.filter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

@media (max-width: 768px) {
    .date-filter-container {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .date-input, .filter-select {
        width: 100%;
        margin-right: 0;
        margin-bottom: 5px;
    }
}
