/* assets/css/style.css */

/* ==========================================================================
   1. BAZA I ZMIENNE KOLORYSTYCZNE
   ========================================================================== */
:root {
    --primary: rgb(68, 84, 106); 
    --primary-light: rgb(88, 104, 126);
    --accent: rgb(38, 166, 178); 
    --accent-hover: rgb(28, 146, 158);
    --bg-light: #f4f7f6;
    --text-dark: #333;
    --text-muted: #666;
}

html {
    scroll-behavior: smooth; /* To daje płynne przewijanie! */
    scroll-padding-top: 110px; /* To sprawia, że strona zatrzyma się 90px niżej, żeby przyklejone menu nie zasłoniło tytułu sekcji */
}

body { 
    margin: 0; padding: 0; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    color: var(--text-dark); background-color: #f4f4f9; 
}
a { text-decoration: none; color: inherit; }

/* ==========================================================================
   2. TOPBAR I KONTENERY (PANEL, JPK, KLIENCI)
   ========================================================================== */
.topbar { background-color: var(--primary); color: white; padding: 15px 5%; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.brand-container { display: flex; align-items: center; }
.brand-container img.logo { height: 50px; width: auto; margin-right: 15px; }
.topbar h1 { margin: 0; font-size: 1.5rem; color: white; }
.topbar-actions { display: flex; gap: 15px; align-items: center; }

.container { max-width: 1200px; margin: 40px auto; padding: 0 5%; }
.header-info { margin-bottom: 30px; color: var(--primary); display: flex; justify-content: space-between; align-items: center; }
.header-info h2, .header-info h3 { margin: 0; }

.info-panel { background: white; border-radius: 8px; padding: 20px 30px; margin-bottom: 25px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); border-left: 5px solid var(--accent); display: flex; justify-content: space-between; align-items: center; }
.info-panel h2, .info-panel h3 { margin: 0 0 5px 0; color: var(--primary); }
.info-panel p { margin: 0; color: #666; font-size: 0.95rem; }

/* ==========================================================================
   3. PRZYCISKI I ALERTY
   ========================================================================== */
.nav-btn, .logout-btn { color: white; border: 1px solid white; padding: 7px 14px; border-radius: 4px; font-size: 0.9rem; transition: 0.3s; display: inline-block; background: transparent; }
.nav-btn:hover, .logout-btn:hover { background-color: white; color: var(--primary); }

.btn-main, .btn-cta, .action-btn, .btn-save, button[type="submit"] { background-color: var(--accent); color: white; border: none; padding: 10px 20px; border-radius: 4px; font-weight: bold; cursor: pointer; transition: 0.3s; font-size: 1rem; display: inline-block; box-shadow: 0 4px 10px rgba(38, 166, 178, 0.2); text-decoration: none;}
.btn-main:hover, button[type="submit"]:hover, .btn-save:hover { background-color: var(--accent-hover); transform: translateY(-1px); }
.btn-cancel { background: white; border: 1px solid #ccc; color: #333; padding: 10px 15px; border-radius: 4px; cursor: pointer; margin-right: 10px; font-weight: bold; text-decoration: none;}

.alert { padding: 15px; border-radius: 4px; margin-bottom: 25px; line-height: 1.6; text-align: center; font-weight: bold; }
.alert.success, .success { background-color: #edf8f3; color: #28a745; border: 1px solid #c3e6cb; }
.alert.error, .error { background-color: #fdf7f7; color: #d9534f; border: 1px solid #ebccd1; }

/* ==========================================================================
   4. TABELE I KAFELKI (APPS GRID)
   ========================================================================== */
.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.data-table th, .data-table td { padding: 15px; text-align: left; border-bottom: 1px solid #eaeaea; }
.data-table th { background-color: #f8f9fa; color: var(--primary); font-weight: bold; font-size: 0.9rem; text-transform: uppercase; }
.data-table tr:hover { background-color: #fdfdfd; }
.link-edit { color: var(--accent); text-decoration: none; font-weight: bold; margin-right: 10px; cursor: pointer; }
.link-edit:hover { text-decoration: underline; }
.link-edit.delete { color: #d9534f; }
.badge { background-color: var(--primary); color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.85rem; font-weight: bold; }

.apps-grid { display: flex; justify-content: center; flex-wrap: wrap; gap: 30px; margin-bottom: 40px; }
.app-card { width: 300px; background: white; border-radius: 12px; padding: 30px 20px; text-align: center; box-shadow: 0 5px 20px rgba(0,0,0,0.05); border: 1px solid #eaeaea; border-bottom: 4px solid transparent; transition: 0.3s; display: block; box-sizing: border-box; text-decoration: none;}
.app-card:hover { transform: translateY(-10px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); border-bottom-color: var(--accent); }
.app-card h2 { margin: 0 0 10px 0; color: var(--primary); font-size: 1.5rem; }
.app-card p { margin: 0; color: var(--text-muted); font-size: 1rem; line-height: 1.6; }
.app-card .icon { font-size: 3rem; margin-bottom: 20px; display: block; color: var(--accent); }

/* ==========================================================================
   5. FORMULARZE I MODALE (ODTWORZONE Z WCZORAJ)
   ========================================================================== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.form-group { margin-bottom: 20px; text-align: left; }
.form-row .form-group { margin-bottom: 0; }
.form-group label { display: block; margin-bottom: 8px; color: var(--primary); font-weight: bold; font-size: 0.9rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select, textarea { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; transition: 0.3s; font-family: inherit; font-size: 1rem; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 5px rgba(38, 166, 178, 0.3); }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; }
.modal-content { background: white; width: 500px; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); overflow: hidden; display: flex; flex-direction: column; max-height: 90vh; }
.modal-header { background: var(--primary); color: white; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 1.2rem; }
.modal-close { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; opacity: 0.8; }
.modal-close:hover { opacity: 1; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { padding: 15px 20px; background: #f8f9fa; border-top: 1px solid #eaeaea; text-align: right; }

/* SPECJALNE STYLE DLA MODALA LOGOWANIA NA STRONIE GŁÓWNEJ */
.login-modal { max-width: 400px !important; text-align: center; border-top: 5px solid var(--accent) !important; }
.login-modal .modal-header { background: white; justify-content: center; padding-bottom: 0; padding-top: 30px; color: var(--primary); }
.login-modal .modal-header h3 { display: none; }
.login-modal .modal-close { position: absolute; top: 15px; right: 20px; color: var(--text-muted); }
.login-modal .modal-close:hover { color: var(--text-dark); }

/* ==========================================================================
   6. ELEMENTY JPK (ODTWORZONE Z WCZORAJ)
   ========================================================================== */
.tabs { border-bottom: 2px solid #ddd; margin-bottom: 20px; }
.tab-btn { padding: 12px 25px; background: none; border: none; cursor: pointer; font-weight: bold; color: #999; border-bottom: 3px solid transparent; margin-bottom: -2px; font-size: 1rem; }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.tab-content.active { display: block; }
.decl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }

.drop-zone { border: 3px dashed var(--accent); padding: 50px; text-align: center; border-radius: 10px; cursor: pointer; color: var(--primary); transition: 0.3s; background: white; margin-bottom: 20px; }
.drop-zone:hover { background: #f0fbfc; border-color: var(--accent-hover); }

/* ==========================================================================
   7. STRONA GŁÓWNA (HOME)
   ========================================================================== */
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 5%; background: white; box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100; }
.logo-container img.logo { height: 60px; width: auto; }
.nav-links { display: flex; gap: 30px; align-items: center; font-weight: 600; color: var(--primary); }
.nav-links a:hover { color: var(--accent); transition: 0.3s; }
.btn-login { background-color: var(--primary); color: white; padding: 10px 20px; border-radius: 6px; transition: 0.3s; border: 2px solid var(--primary); cursor: pointer;}
.btn-login:hover { background-color: transparent; color: var(--primary); }

.hero { display: flex; align-items: center; justify-content: space-between; padding: 80px 5%; background: linear-gradient(135deg, #ffffff 0%, var(--bg-light) 100%); min-height: 70vh; }
.hero-text { flex: 1; max-width: 600px; padding-right: 40px; }
.hero-text h1 { font-size: 3rem; color: var(--primary); margin-bottom: 20px; line-height: 1.2; }
.hero-text h1 span { color: var(--accent); }
.hero-text p { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 30px; line-height: 1.6; }
.hero-image { flex: 1; text-align: center; }
.hero-image img { max-width: 100%; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

.services { padding: 80px 5%; text-align: center; background-color: white; }
.section-title { font-size: 2.5rem; color: var(--primary); margin-bottom: 15px; }
.section-subtitle { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 50px; text-align: center; }

.integration { background-color: var(--primary); color: white; padding: 80px 5%; display: flex; align-items: center; justify-content: space-between; border-radius: 20px; margin: 0 5% 80px 5%; }
.int-text { flex: 1; padding-right: 40px; }
.int-text h2 { font-size: 2.2rem; margin-bottom: 20px; }
.int-text p { font-size: 1.1rem; line-height: 1.6; margin-bottom: 0; opacity: 0.9; }

.int-logo { flex: 1; text-align: right; display: flex; flex-direction: column; gap: 15px; align-items: flex-end; }
.partner-btn { display: inline-block; transition: 0.3s; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.2); line-height: 0; }
.partner-btn:hover { transform: scale(1.05); box-shadow: 0 6px 15px rgba(0,0,0,0.3); }
.partner-btn img { height: 65px; width: auto; border-radius: 12px; display: block; }

footer { background-color: #f8f9fa; padding: 60px 5% 40px 5%; text-align: center; border-top: 1px solid #eaeaea; color: var(--text-muted); }
.contact-form-container { max-width: 600px; margin: 0 auto 40px auto; text-align: left; background: white; padding: 30px; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); }

@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 15px; }
    .hero, .integration { flex-direction: column; text-align: center; }
    .hero-text, .int-text { padding-right: 0; margin-bottom: 40px; }
    .int-logo { align-items: center; }
    .form-row { grid-template-columns: 1fr; }
}