* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

header h1 img {
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
    border-radius: 8px;
}

header h1 img:hover {
    transform: scale(1.05);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-top: 10px;
}

.header-links {
    margin-top: 15px;
}

.test-link {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.test-link:hover {
    background: rgba(220, 38, 38, 0.3);
    border: 1px solid rgba(220, 38, 38, 0.5);
}

main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.upload-section h2 {
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 30px;
}

#imageInput {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 3px dashed #dc2626;
    border-radius: 15px;
    background: #fef2f2;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-label:hover {
    border-color: #991b1b;
    background: #fee2e2;
    transform: translateY(-2px);
}

.file-text {
    font-size: 1.2rem;
    color: #dc2626;
    margin-bottom: 10px;
    font-weight: 600;
}

.file-icon {
    font-size: 2rem;
}

.preview-container {
    margin: 20px 0;
    text-align: center;
}

#imagePreview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.preview-actions {
    margin-top: 15px;
}

.base64-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.base64-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.4);
}

.base64-btn:active {
    transform: translateY(0);
}

.instructions-section {
    margin-bottom: 30px;
}

.instructions-section h3 {
    margin-bottom: 15px;
    color: #333;
}

#instructions {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#instructions:focus {
    outline: none;
    border-color: #dc2626;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

.results-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e1e5e9;
}

.results-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.result-item {
    background: #fef2f2;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #dc2626;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.1);
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(220, 38, 38, 0.15);
}

.result-item h4 {
    margin-bottom: 10px;
    color: #333;
}

.result-item img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin: 10px 0;
}

.image-actions {
    margin-top: 15px;
}

.download-base64-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(23, 162, 184, 0.3);
}

.download-base64-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.4);
}

.download-base64-btn:active {
    transform: translateY(0);
}

.download-section {
    text-align: center;
    margin-top: 30px;
}

.download-btn {
    padding: 12px 24px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.error-section {
    margin-top: 20px;
}

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

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

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

/* Style dla promptów */
.prompt-selector {
    margin-bottom: 20px;
}

.prompt-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.prompt-selector select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
}

.prompt-input {
    margin-top: 15px;
}

.prompt-preview {
    margin-top: 15px;
    padding: 15px;
    background: #fef2f2;
    border-radius: 8px;
    border-left: 4px solid #dc2626;
}

.prompt-preview h4 {
    margin-bottom: 10px;
    color: #333;
}

.prompt-image img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 6px;
    margin-top: 10px;
}

/* Zarządzanie promptami */
.prompts-management-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e1e5e9;
}

.prompts-list {
    margin-bottom: 20px;
}

.prompt-item {
    background: #fef2f2;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #dc2626;
    position: relative;
}

.prompt-item h4 {
    margin-bottom: 8px;
    color: #333;
}

.prompt-item p {
    margin-bottom: 10px;
    color: #666;
}

.prompt-item .prompt-image {
    margin-top: 10px;
}

.prompt-item .prompt-image img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 6px;
}

.delete-prompt {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 14px;
}

.add-prompt-btn {
    padding: 12px 24px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-prompt-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
}

/* Style dla strony logowania */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-box h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #333;
}

.login-box h2 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #666;
}

.login-form {
    margin-bottom: 20px;
}

.login-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-form input[type="password"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
}

.login-form input[type="password"]:focus {
    outline: none;
    border-color: #dc2626;
}

.login-form .submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-form .submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.login-info {
    background: #fef2f2;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e1e5e9;
}

.login-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.logout-link {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.logout-link:hover {
    background: rgba(220, 38, 38, 0.3);
    border: 1px solid rgba(220, 38, 38, 0.5);
}

/* Style dla nowych elementów */
.info-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.info-box h4 {
    color: #dc2626;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.info-box ol {
    margin-left: 20px;
    color: #666;
}

.info-box li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.info-box li::marker {
    color: #dc2626;
}

.base-image-section,
.prompt-images-section {
    margin-bottom: 30px;
}

.base-image-section h3,
.prompt-images-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4rem;
    border-bottom: 3px solid #dc2626;
    padding-bottom: 10px;
    position: relative;
}

.base-image-section h3::after,
.prompt-images-section h3::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 50px;
    height: 3px;
    background: #991b1b;
    border-radius: 2px;
}

.result-item.base-image {
    border: 3px solid #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.result-item.prompt-image {
    border: 2px solid #991b1b;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

.summary-info {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
    color: #0c5460;
}

.summary-info p {
    margin: 0;
    font-weight: 600;
}

/* Style dla debug_logs.php */
.logs-section {
    margin-bottom: 30px;
}

.log-file-item {
    background: #fef2f2;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.log-file-item h3 {
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #dc2626;
    padding-bottom: 10px;
}

.log-content {
    margin-top: 15px;
}

.log-content h4 {
    color: #666;
    margin-bottom: 10px;
}

.log-lines {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.9rem;
}

.log-line {
    padding: 2px 0;
    border-bottom: 1px solid #eee;
}

.log-line:last-child {
    border-bottom: none;
}

.system-info-section {
    margin-bottom: 30px;
}

.system-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.system-item {
    background: #fef2f2;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    padding: 20px;
}

.system-item h4 {
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #dc2626;
    padding-bottom: 10px;
}

.system-item ul {
    list-style: none;
    padding: 0;
}

.system-item li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.system-item li:last-child {
    border-bottom: none;
}

.config-section {
    margin-bottom: 30px;
}

.config-item {
    background: #fef2f2;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

.config-item.error {
    background: #fff5f5;
    border-color: #feb2b2;
}

.config-item h4 {
    color: #333;
    margin-bottom: 10px;
}

.config-item p {
    margin: 0;
    color: #666;
}

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

.result-item p {
    margin-bottom: 8px;
    color: #666;
}

.result-item a {
    color: #17a2b8;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.result-item a:hover {
    color: #138496;
    text-decoration: underline;
}

/* Style dla porównania promptów */
.prompt-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.prompt-original,
.prompt-result {
    background: #fef2f2;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.prompt-original h5,
.prompt-result h5 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
    border-bottom: 2px solid #dc2626;
    padding-bottom: 8px;
}

.prompt-original img,
.prompt-result img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.prompt-original p,
.prompt-result p {
    margin: 8px 0;
    color: #666;
    font-size: 0.9rem;
}

/* Style dla sekcji JSON */
.json-data-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e1e5e9;
}

.json-data-section h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4rem;
}

.json-container {
    background: #fef2f2;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    padding: 20px;
    position: relative;
}

.json-container pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0 0 20px 0;
}

.json-container code {
    color: inherit;
}

.copy-json-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(220, 38, 38, 0.3);
}

.copy-json-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.4);
}

.copy-json-btn:active {
    transform: translateY(0);
}

/* Responsywność dla porównania promptów */
@media (max-width: 768px) {
    .prompt-comparison {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .prompt-original,
    .prompt-result {
        padding: 15px;
    }
    
    .copy-json-btn {
        position: static;
        margin-top: 15px;
        width: 100%;
    }
} 