/* styles.css - Główny arkusz stylów dla aplikacji XML Konwerter */

/* Resetowanie i podstawowe style */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e4e8;
}

header h1 {
    color: #2563eb;
    margin-bottom: 10px;
}

/* Karty i zakładki */
.tab {
    overflow: hidden;
    border: 1px solid #e1e4e8;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
    display: flex;
    flex-wrap: wrap;
}

.tab button {
    background-color: inherit;
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: 0.3s;
    font-size: 16px;
    font-weight: 500;
    color: #4b5563;
    flex: 1;
    min-width: 120px;
}

.tab button:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

.tab button.active {
    background-color: #2563eb;
    color: white;
}

.tabcontent {
    display: none;
    padding: 20px 0;
    border-top: none;
    animation: fadeEffect 0.5s;
}

@keyframes fadeEffect {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* Karty i siatki */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    .tab button {
        flex: none;
        width: 50%;
    }
}

/* Przyciski i formularze */
button, input[type="submit"] {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.primary-btn {
    background-color: #2563eb;
    color: white;
}

.primary-btn:hover {
    background-color: #1d4ed8;
}

.secondary-btn {
    background-color: #e5e7eb;
    color: #1f2937;
}

.secondary-btn:hover {
    background-color: #d1d5db;
}

.toggle-btn {
    background-color: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

.toggle-btn:hover, .toggle-btn.active {
    background-color: #2563eb;
    color: white;
    border-color: #2563eb;
}

.btn-group {
    display: flex;
    gap: 10px;
}

input[type="text"],
input[type="number"],
input[type="password"],
select {
    width: 100%;
    padding: 8px 12px;
    margin: 8px 0;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

input[type="file"] {
    margin: 10px 0;
    width: 100%;
}

.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.form-row label {
    flex: 0 0 25%;
    min-width: 150px;
}

.form-row input, .form-row select {
    flex: 1;
    margin: 0;
}

.checkbox-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Podgląd XML */
.xml-preview {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: #1e1e1e;
    padding: 10px;
    margin-top: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
}

.xml-preview pre {
    margin: 0;
    white-space: pre-wrap;
}

.xml-preview code {
    font-family: 'Consolas', 'Monaco', monospace;
}

.xml-preview-controls {
    margin-bottom: 10px;
}

/* Lista plików */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.file-card {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 15px;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

.file-card:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.file-name {
    font-weight: 600;
    margin-bottom: 8px;
    word-break: break-word;
}

.file-info {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 10px;
}

.file-actions {
    display: flex;
    gap: 5px;
}

/* Komunikaty i powiadomienia */
.success-message, .error-message {
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

.success-message {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.error-message {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
}

.placeholder {
    color: #9ca3af;
    text-align: center;
    padding: 20px;
}

/* Loader i spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #2563eb;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 80%;
}

/* Ustawienia i status */
.settings-group {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.settings-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

#systemInfo {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    white-space: pre-wrap;
}

/* Responsywność */
@media (max-width: 640px) {
    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row label {
        margin-bottom: 5px;
    }

    .btn-group {
        flex-direction: column;
    }

    .files-grid {
        grid-template-columns: 1fr;
    }
}