/**
 * 57TOOLS BOK - Simple Styles
 * Uproszczone style CSS dla całej aplikacji
 */

/* === RESET I PODSTAWY === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #f5f5f5;
    overflow-x: hidden;
}

/* === KOLORY - Material Design 3 === */
:root {
    /* Primary Colors */
    --md-primary: #6750A4;
    --md-primary-container: #EADDFF;
    --md-on-primary: #FFFFFF;
    --md-on-primary-container: #21005D;

    /* Secondary Colors */
    --md-secondary: #625B71;
    --md-secondary-container: #E8DEF8;
    --md-on-secondary: #FFFFFF;
    --md-on-secondary-container: #1D192B;

    /* Tertiary Colors */
    --md-tertiary: #7D5260;
    --md-tertiary-container: #FFD8E4;
    --md-on-tertiary: #FFFFFF;
    --md-on-tertiary-container: #31111D;

    /* Error Colors */
    --md-error: #B3261E;
    --md-error-container: #F9DEDC;
    --md-on-error: #FFFFFF;
    --md-on-error-container: #410E0B;

    /* Success Colors (custom) */
    --md-success: #2E7D32;
    --md-success-container: #C8E6C9;
    --md-on-success: #FFFFFF;

    /* Warning Colors (custom) */
    --md-warning: #F57C00;
    --md-warning-container: #FFE0B2;
    --md-on-warning: #FFFFFF;

    /* Background & Surface */
    --md-surface: #FFFBFE;
    --md-surface-variant: #E7E0EC;
    --md-on-surface: #1C1B1F;
    --md-on-surface-variant: #49454F;
    --md-background: #FFFBFE;
    --md-on-background: #1C1B1F;

    /* Outline */
    --md-outline: #79747E;
    --md-outline-variant: #CAC4D0;

    /* Shadows - Material Design 3 */
    --md-shadow-1: 0px 1px 2px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
    --md-shadow-2: 0px 1px 2px rgba(0, 0, 0, 0.3), 0px 2px 6px 2px rgba(0, 0, 0, 0.15);
    --md-shadow-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px rgba(0, 0, 0, 0.3);

    /* Legacy support - map old variables to new */
    --primary: var(--md-primary);
    --primary-dark: #4F378B;
    --secondary: var(--md-secondary);
    --surface: var(--md-surface);
    --background: var(--md-background);
    --error: var(--md-error);
    --success: var(--md-success);
    --warning: var(--md-warning);
    --text: var(--md-on-surface);
    --text-light: var(--md-on-surface-variant);
    --border: var(--md-outline-variant);
    --shadow: var(--md-shadow-2);
}

/* === LOADING SCREEN === */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* === FORMULARZ LOGOWANIA === */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--surface);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    margin: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

/* === INPUT CONTAINERS === */
.input-container {
    position: relative;
    display: flex;
    align-items: center;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    transition: border-color 0.2s ease;
}

.input-container:focus-within {
    border-color: var(--primary);
}

.input-container .material-icons {
    color: var(--primary);
    margin: 0 12px;
    font-size: 20px;
}

.input-container input {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 12px 16px 0;
    font-size: 16px;
    font-family: inherit;
    background: transparent;
}

.input-container input::placeholder {
    color: var(--text-light);
}

/* === PRZYCISKI - Material Design 3 === */
.login-button, .icon-button, .btn {
    background: var(--md-primary);
    color: var(--md-on-primary);
    border: none;
    border-radius: 20px; /* MD3 uses more rounded corners */
    padding: 10px 24px;
    height: 40px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.1px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: var(--md-shadow-1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.login-button:hover, .icon-button:hover, .btn:hover {
    background: var(--primary-dark);
    box-shadow: var(--md-shadow-2);
}

.login-button:active, .icon-button:active, .btn:active {
    box-shadow: var(--md-shadow-1);
}

.login-button:disabled, .btn:disabled {
    background: rgba(28, 27, 31, 0.12);
    color: rgba(28, 27, 31, 0.38);
    cursor: not-allowed;
    box-shadow: none;
}

.icon-button {
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background: transparent;
    box-shadow: none;
}

.icon-button:hover {
    background: rgba(103, 80, 164, 0.08);
}

/* Button Variants - MD3 Style */
.btn-primary {
    background: var(--md-primary);
    color: var(--md-on-primary);
}

.btn-secondary {
    background: var(--md-secondary-container);
    color: var(--md-on-secondary-container);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--md-secondary-container);
    box-shadow: var(--md-shadow-1);
}

.btn-outline {
    background: transparent;
    color: var(--md-primary);
    border: 1px solid var(--md-outline);
    box-shadow: none;
}

.btn-outline:hover {
    background: rgba(103, 80, 164, 0.08);
    border-color: var(--md-primary);
}

.btn-success {
    background: var(--md-success);
    color: var(--md-on-success);
}

.btn-success:hover {
    background: #1B5E20;
}

.btn-warning {
    background: var(--md-warning);
    color: var(--md-on-warning);
}

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

.btn-danger, .btn-error {
    background: var(--md-error);
    color: var(--md-on-error);
}

.btn-danger:hover, .btn-error:hover {
    background: #8C1D18;
}

/* === WIADOMOŚCI === */
.error-message {
    color: var(--error);
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.success-message {
    color: var(--success);
    font-size: 14px;
    margin-top: 8px;
}

/* === DASHBOARD === */
.dashboard {
    display: none;
    flex-direction: column;
    height: 100vh;
}

/* App Bar */
.app-bar {
    background: var(--surface);
    box-shadow: var(--shadow);
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
}

.app-bar-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

.app-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

/* Navigation Drawer */
.navigation-drawer {
    position: fixed;
    left: -280px;
    top: 64px;
    width: 280px;
    height: calc(100vh - 64px);
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: left 0.3s ease;
    z-index: 99;
    overflow-y: auto;
}

.navigation-drawer.open {
    left: 0;
}

.nav-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.nav-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.nav-content {
    padding: 16px 0;
}

/* Navigation Tabs - MD3 Style */
.nav-tab {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    margin: 4px 12px;
    cursor: pointer;
    border-radius: 28px;
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    color: var(--md-on-surface-variant);
    position: relative;
}

.nav-tab:hover {
    background: rgba(103, 80, 164, 0.08);
    color: var(--md-on-surface);
}

.nav-tab.active {
    background: var(--md-secondary-container);
    color: var(--md-on-secondary-container);
}

.nav-tab .material-icons {
    font-size: 24px;
}

.nav-tab span {
    font-weight: 500;
    letter-spacing: 0.1px;
}

.nav-separator {
    height: 1px;
    background: var(--border);
    margin: 16px 24px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 24px;
    margin-left: 0;
    transition: margin-left 0.3s ease;
    overflow-y: auto;
}

.main-content.drawer-open {
    margin-left: 280px;
}

/* Modules */
.module {
    display: none;
}

.module.active {
    display: block;
}

.module-header {
    margin-bottom: 32px;
}

.module-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.module-header .material-icons {
    font-size: 28px;
    color: var(--primary);
}

.module-header p {
    color: var(--text-light);
    font-size: 16px;
}

.module-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Welcome Module */
.welcome-container {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.welcome-header {
    margin-bottom: 48px;
}

.welcome-icon {
    font-size: 64px !important;
    color: var(--primary);
    margin-bottom: 24px;
}

.welcome-header h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.welcome-header p {
    font-size: 18px;
    color: var(--text-light);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

/* Module Cards - MD3 Elevated Cards */
.module-card {
    background: var(--md-surface);
    padding: 32px 24px;
    border-radius: 16px; /* MD3 uses larger radius */
    box-shadow: var(--md-shadow-1);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    text-align: center;
    border: 1px solid var(--md-outline-variant);
}

.module-card:hover {
    box-shadow: var(--md-shadow-3);
    transform: translateY(-2px);
    border-color: var(--md-primary);
    background: var(--md-primary-container);
}

.module-card .material-icons {
    font-size: 48px;
    color: var(--md-primary);
    margin-bottom: 16px;
}

.module-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--md-on-surface);
}

.module-card p {
    color: var(--md-on-surface-variant);
    line-height: 1.5;
}

/* Cards - MD3 Filled Cards */
.card {
    background: var(--md-surface);
    border-radius: 16px;
    box-shadow: var(--md-shadow-1);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--md-outline-variant);
}

.card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--md-on-surface);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--md-outline-variant);
}

.card-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header .material-icons {
    color: var(--md-primary);
}

.card-content {
    color: var(--md-on-surface);
}

.card-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: var(--shadow);
    max-width: 400px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideInRight 0.3s ease-out;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--primary);
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
    margin-left: 16px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .main-content {
        padding: 16px;
        margin-left: 0 !important;
    }
    
    .navigation-drawer {
        width: 100%;
        left: -100%;
    }
    
    .login-card {
        margin: 16px;
        padding: 24px;
    }
    
    .module-grid {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .card-actions {
        align-self: stretch;
    }
    
    .toast {
        margin: 0 16px;
        max-width: calc(100% - 32px);
    }
}

/* === UTILITIES === */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-16 {
    margin-top: 16px;
}

.mb-16 {
    margin-bottom: 16px;
}

.p-16 {
    padding: 16px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

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

.gap-16 {
    gap: 16px;
}

.w-full {
    width: 100%;
}

.admin-only {
    display: none;
}

.admin-only.visible {
    display: block;
}

/* === TABS === */
.tab-header {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.tab-button:hover {
    background: rgba(25, 118, 210, 0.08);
}

.tab-button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(25, 118, 210, 0.08);
}

.tab-content {
    display: block;
}

/* === FORMULARZ EMAIL === */
.email-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.full-width {
    width: 100%;
}

.flex-grow {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }
}