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

/* Date Range Picker Styles */
.date-range-picker {
    position: relative;
    margin-bottom: 15px;
}

.date-display {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.date-display:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.date-display-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.date-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.date-value {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

.date-value.selected {
    color: #667eea;
}

.date-separator {
    margin: 0 20px;
    color: #667eea;
    font-size: 1.2rem;
}

.calendar-icon {
    position: absolute;
    right: 15px;
    color: #667eea;
    font-size: 1.2rem;
}

.calendar-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 8px;
    padding: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-nav {
    background: none;
    border: none;
    color: #667eea;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.calendar-nav:hover {
    background: #f0f4ff;
    color: #4f46e5;
}

.calendar-month {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 20px;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    font-weight: 600;
    padding: 8px 0;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-day:hover {
    background: #f0f4ff;
}

.calendar-day.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.calendar-day.disabled:hover {
    background: none;
}

.calendar-day.other-month {
    color: #ccc;
}

.calendar-day.selected {
    background: #667eea;
    color: white;
}

.calendar-day.in-range {
    background: #e8f2ff;
    color: #667eea;
}

.calendar-day.range-start {
    background: #667eea;
    color: white;
    border-radius: 8px 0 0 8px;
}

.calendar-day.range-end {
    background: #667eea;
    color: white;
    border-radius: 0 8px 8px 0;
}

.calendar-day.range-start.range-end {
    border-radius: 8px;
}

.calendar-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.btn-calendar-clear,
.btn-calendar-confirm {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-calendar-clear {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e1e5e9;
}

.btn-calendar-clear:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.btn-calendar-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-calendar-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.calendar-close {
    background: none;
    border: 2px solid #e1e5e9;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.calendar-close:hover {
    background: #f0f4ff;
    color: #667eea;
    border-color: #667eea;
    transform: scale(1.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .date-display {
        padding: 12px 15px;
    }
    
    .date-separator {
        margin: 0 15px;
        font-size: 1rem;
    }
    
    .calendar-container {
        padding: 15px;
    }
    
    .calendar-grid {
        gap: 2px;
    }
    
    .calendar-day {
        font-size: 0.8rem;
    }
    
    .btn-calendar-clear,
    .btn-calendar-confirm {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

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

/* Login Page Styles */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-header .logo {
    margin-bottom: 20px;
}

.login-header .logo i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 10px;
}

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

.tagline {
    color: #666;
    font-size: 1rem;
    margin-bottom: 30px;
}

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

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

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

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-bottom: 20px;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.login-footer {
    margin-top: 20px;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

.error-message {
    display: none;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 0.9rem;
}

.error-message.error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.error-message.success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* Home Page Styles */
.home-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    color: white;
}

.header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header .logo i {
    font-size: 2rem;
}

.header h1 {
    font-size: 1.8rem;
    margin: 0;
}

.header .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

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

.calendar-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-title {
    font-size: 1.3rem;
    color: #333;
    font-weight: 600;
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-nav button {
    background: #f8f9fa;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: #667eea;
    font-size: 1.1rem;
}

.calendar-nav button:hover {
    background: #e9ecef;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

.calendar-day:hover {
    background: #f8f9fa;
}

.calendar-day.selected {
    background: #667eea;
    color: white;
}

.calendar-day.other-month {
    color: #ccc;
}

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

.feature-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 15px;
}

.feature-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.feature-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Page Styles */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-header i {
    font-size: 2rem;
    color: #667eea;
}

.page-title {
    font-size: 1.8rem;
    color: #333;
    margin: 0;
}

.page-subtitle {
    color: #666;
    font-size: 1rem;
    margin-top: 5px;
}

.content-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
}

.btn-danger {
    background: #dc3545;
}

.btn-success {
    background: #28a745;
}

.currency-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.currency-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.currency-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    border: 1px solid #fcc;
    display: none;
}

.success-message {
    background: #efe;
    color: #3c3;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    border: 1px solid #cfc;
    display: none;
}

.data-list {
    list-style: none;
}

.data-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-item-content {
    flex: 1;
}

.data-item-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .home-body {
        padding: 5px;
    }
    
    .page-container {
        padding: 8px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .page-header {
        flex-direction: column;
        text-align: center;
    }
    
    .currency-buttons {
        flex-direction: column;
    }
    
    .data-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .data-item-actions {
        justify-content: center;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

.modal-content, .tag-detail-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
}

.modal-body .calendar-section {
    background: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

/* Tag Detail Modal Styles */
.tag-detail-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tag-detail-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.tag-detail-field label {
    font-weight: 600;
    color: #495057;
    min-width: 100px;
    margin: 0;
}

.tag-detail-field span {
    color: #212529;
    flex: 1;
}

.tag-id-badge {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tag-category-badge {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #e1e5e9;
    justify-content: flex-end;
}

.modal-actions .btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.modal-actions .btn-primary {
    background: #007bff;
    color: white;
}

.modal-actions .btn-success {
    background: #28a745;
    color: white;
}

.modal-actions .btn-danger {
    background: #dc3545;
    color: white;
}

.modal-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.modal-actions .btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
