/**
 * Główne style CSS dla aplikacji Generatorów Etykiet
 * Nowoczesny, responsywny design z czystym kodem
 */

/* Reset i podstawowe ustawienia */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* Kontener główny */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Nagłówek */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header p {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

/* Sekcje */
.section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 4px solid #3498db;
}

/* Siatka kart */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Karty */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.15);
}

.card:hover .card-icon {
    transform: scale(1.1) translateY(-2px);
    animation: iconBounce 0.6s ease-in-out;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1.1) translateY(-2px); }
    50% { transform: scale(1.2) translateY(-8px); }
}

.card-header {
    padding: 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    position: relative;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card-description {
    font-size: 0.9rem;
    opacity: 0.9;
}

.card-body {
    padding: 1.5rem;
}

.card-content {
    margin-bottom: 1.5rem;
}

/* Przyciski */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-primary {
    background: #3498db;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Uniwersalne style formularzy */
.form-input, 
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: #495057;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.form-input:focus,
.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background: #fff;
}

.form-input:hover,
.form-control:hover {
    border-color: #ced4da;
}

.form-input::placeholder,
.form-control::placeholder {
    color: #6c757d;
    opacity: 1;
}

.form-input:disabled,
.form-control:disabled {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

/* Textarea specyficzne style */
textarea.form-input,
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Select style */
select.form-input,
select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Checkbox i radio style */
input[type="checkbox"],
input[type="radio"] {
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.5rem;
    accent-color: #3498db;
    cursor: pointer;
}

/* Form group styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
    font-size: 0.95rem;
}

.form-group label.required::after {
    content: " *";
    color: #e74c3c;
}

.search-box.full-width {
    max-width: 100% !important;
}

/* Search box styling */
.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box .form-input {
    padding-left: 2.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z'/%3e%3c/svg%3e");
    background-position: left 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem 1.25rem;
}

/* Input size variants */
.form-input-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.form-input-lg {
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
}

/* Input state variants */
.form-input.is-valid,
.form-control.is-valid {
    border-color: #28a745;
}

.form-input.is-valid:focus,
.form-control.is-valid:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.form-input.is-invalid,
.form-control.is-invalid {
    border-color: #dc3545;
}

.form-input.is-invalid:focus,
.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Form help text */
.form-help {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.875rem;
    color: #dc3545;
    margin-top: 0.25rem;
}

.form-success {
    font-size: 0.875rem;
    color: #28a745;
    margin-top: 0.25rem;
}

/* Formularz administratora (legacy compatibility) */
.admin-form {
    margin-top: 1rem;
}

.admin-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.admin-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.admin-error {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 4px;
    border-left: 3px solid #e74c3c;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    max-width: 400px;
    width: 90vw;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    padding: 2rem;
    text-align: center;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-title {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.modal-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.modal-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.modal-error {
    color: #e74c3c;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 6px;
    border-left: 3px solid #e74c3c;
}

/* Stopka */
.footer {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    font-size: 0.875rem;
    color: #7f8c8d;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logout-btn {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 15px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.logout-btn:hover {
    background: #c0392b;
}

/* Breadcrumb nawigacji */
.breadcrumb {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child):after {
    content: ">";
    margin: 0 0.5rem;
    color: #7f8c8d;
    font-weight: bold;
}

.breadcrumb-item a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #2c3e50;
    font-weight: 600;
}

/* Przycisk powrotu */
.back-button-container {
    margin-bottom: 1.5rem;
}

/* Animacje */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Styles dla alertów - komponenty powiadomień */
.alert {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    margin: 1rem auto 2rem;
    max-width: 1200px;
    border-radius: 8px;
    font-weight: 500;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    animation: alertSlideIn 0.3s ease-out;
}

.alert-icon {
    font-size: 1.25rem;
    font-weight: bold;
    min-width: 24px;
    text-align: center;
}

.alert-message {
    flex: 1;
    font-size: 1rem;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 2px solid #b8daff;
    color: #155724;
}

.alert-success .alert-icon {
    color: #28a745;
}

.alert-error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 2px solid #f5c6cb;
    color: #721c24;
}

.alert-error .alert-icon {
    color: #dc3545;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #ffeaa7;
    color: #856404;
}

.alert-warning .alert-icon {
    color: #f39c12;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border: 2px solid #bee5eb;
    color: #0c5460;
}

.alert-info .alert-icon {
    color: #17a2b8;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile alert adjustments */
@media (max-width: 768px) {
    .alert {
        margin: 0.5rem 1rem 1.5rem;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }
    
    .alert-icon {
        font-size: 1rem;
        min-width: 20px;
    }
    
    .alert-message {
        font-size: 0.9rem;
    }
}

/* Print styles hide alerts */
@media print {
    .alert {
        display: none !important;
    }
    body {
        line-height: 1.2;
    }
}

/* Responsywność */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem 0.5rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .footer {
        position: static;
        margin-top: 2rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
}

/* Ukrycie przy drukowaniu */
@media print {
    .footer,
    .no-print {
        display: none !important;
    }
}

/* Form layout utilities */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-row .form-group.col-auto {
    flex: none;
}

.form-row .form-group.col-2 {
    flex: 0 0 16.666667%;
}

.form-row .form-group.col-3 {
    flex: 0 0 25%;
}

.form-row .form-group.col-4 {
    flex: 0 0 33.333333%;
}

.form-row .form-group.col-6 {
    flex: 0 0 50%;
}

.form-row .form-group.col-8 {
    flex: 0 0 66.666667%;
}

.form-row .form-group.col-12 {
    flex: 0 0 100%;
}

/* Form actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.form-actions.left {
    justify-content: flex-start;
}

.form-actions.center {
    justify-content: center;
}

.form-actions.between {
    justify-content: space-between;
}

/* Responsive form adjustments */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 1rem;
    }
    
    .breadcrumb-backbutton-container {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-input,
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .form-input,
    .form-control {
        padding: 0.875rem 1rem;
    }
    
    .search-box .form-input {
        padding-left: 2.75rem;
    }
}

/* Breadcrumb and back button container */
.breadcrumb-backbutton-container {
    display: flex;
    gap: 1rem;
}

.breadcrumb-backbutton-container .back-button-container {
    flex: 1;
}

.breadcrumb-backbutton-container .breadcrumb {
    flex: 2;
}


/* Responsive form adjustments */
@media (max-width: 768px) {
        .breadcrumb-backbutton-container {
        flex-direction: column;
        align-items: stretch;
    }
    .breadcrumb-backbutton-container .back-button-container {
        margin-bottom: 0.5rem;
    }
    .breadcrumb-backbutton-container .breadcrumb {
        margin-bottom: 0.5rem;
    }
}
