/**
 * Stiluri pentru aplicația Trip Planner
 * Versiunea 1.0
 */

/* Reset și variabile CSS */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #43e97b;
    --danger-color: #f5576c;
    --warning-color: #ffa07a;
    --info-color: #4facfe;
    --text-dark: #333;
    --text-gray: #666;
    --text-light: #999;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-md: 0 5px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.2);
    --border-radius: 8px;
    --border-radius-lg: 15px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-gradient);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Tipografie */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

/* Containere */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

.logo:hover {
    opacity: 0.8;
}

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

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.user-avatar:hover {
    transform: scale(1.1);
}

.user-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    display: none;
    margin-top: 0.5rem;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-light);
}

/* Butoane */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    text-align: center;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: var(--border-color);
}

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

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-check {
    display: flex;
    align-items: center;
}

.form-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Alertele */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info-color);
}

/* Pagină autentificare */
.auth-page {
    background: var(--primary-gradient);
    min-height: 100vh;
    overflow: hidden;
}

.auth-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    margin: auto;
}

.auth-box {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .logo {
    justify-content: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-gray);
    font-size: 1.1rem;
}

.language-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-weight: 600;
    color: var(--text-gray);
    transition: var(--transition);
}

.lang-btn.active,
.lang-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.demo-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.875rem;
}

.demo-info code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* Dashboard */
.page-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.page-header h1 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-gray);
    margin: 0;
}

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.tab {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-dark);
    white-space: nowrap;
}

.tab.active,
.tab:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}

/* Grid călătorii */
.trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.trip-card {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
}

.trip-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.trip-header {
    background: var(--primary-gradient);
    color: white;
    padding: 1.5rem;
    position: relative;
}

.trip-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.trip-destination {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.trip-dates {
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trip-body {
    padding: 1.5rem;
}

.participants {
    display: flex;
    margin-bottom: 1rem;
}

.participant-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 3px solid white;
    margin-left: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    color: white;
}

.participant-avatar:first-child {
    margin-left: 0;
}

.trip-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: 0.25rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-gray);
    text-align: center;
}

.quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.quick-btn {
    flex: 1;
    padding: 0.5rem;
    background: var(--bg-light);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.quick-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--border-radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    background: var(--primary-gradient);
    color: white;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.modal-header h2 {
    margin: 0;
}

.modal-body {
    padding: 2rem;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tabs-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
}

.modal-tab {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    font-weight: 600;
    color: var(--text-gray);
    white-space: nowrap;
}

.modal-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Checklist */
.checklist-item {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.checklist-item:hover {
    background: #e9ecef;
}

.checklist-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.checklist-item.completed {
    opacity: 0.6;
}

.checklist-item.completed .item-name {
    text-decoration: line-through;
}

.item-details {
    flex: 1;
}

.item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.item-assigned {
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-gray);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    /* Autentificare mobile */
    .auth-page {
        padding: 0;
    }

    .auth-wrapper {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-container {
        max-width: 100%;
    }

    .auth-box {
        padding: 1.5rem;
        border-radius: var(--border-radius);
    }

    .auth-header {
        margin-bottom: 1.5rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .auth-subtitle {
        font-size: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-control {
        padding: 0.875rem;
        font-size: 16px; /* Previne zoom-ul pe iOS */
    }

    .btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .btn-block {
        width: 100%;
        display: block;
    }

    .language-selector {
        margin-bottom: 1.5rem;
        gap: 0.75rem;
    }

    .lang-btn {
        padding: 0.625rem 1rem;
        font-size: 0.95rem;
        flex: 1;
    }

    .demo-info {
        font-size: 0.8rem;
        padding: 0.75rem;
    }

    .auth-footer {
        font-size: 0.9rem;
    }

    /* Dashboard mobile */
    .trips-grid {
        grid-template-columns: 1fr;
    }

    .actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .header {
        padding: 1rem;
    }

    .user-info span {
        display: none;
    }

    .modal-header {
        padding: 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .trip-stats {
        gap: 0.5rem;
    }

    .stat {
        padding: 0.5rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    /* Filter buttons mobile */
    .filter-btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }

    /* Items list mobile */
    .checklist-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .checklist-item > div:last-child {
        width: 100%;
        justify-content: flex-end;
    }

    /* Header mobile - FIX pentru butoane */
    .header .user-info {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
        margin-top: 0.75rem;
        justify-content: center;
        align-items: center;
    }

    .header .language-selector {
        order: -1;
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .header .btn {
        flex: 1;
        min-width: 120px;
        max-width: 150px;
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
        text-align: center;
        white-space: nowrap;
    }

    /* Guest banner mobile */
    .guest-banner {
        padding: 1rem;
    }

    .guest-banner p {
        font-size: 0.9rem;
    }

    .guest-banner .btn {
        margin: 0.25rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }

    .logo {
        font-size: 1.1rem;
    }

    .header .btn {
        min-width: 100px;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }

    .auth-box {
        padding: 1.25rem;
    }

    .btn {
        font-size: 0.95rem;
    }

    .guest-banner {
        padding: 0.75rem;
    }

    .guest-banner p {
        font-size: 0.85rem;
    }
}

/* Utilități */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.hidden { display: none; }
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { justify-content: center; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
