/* assets/css/style.css */
:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #F3F4F6;
    --card-bg: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --error: #EF4444;
    --success: #10B981;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, var(--primary), #818CF8);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

main {
    flex: 1;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

input[type="text"],
input[type="date"],
input[type="password"],
select,
input[type="file"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #F9FAFB;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
    background-color: white;
}

input[type="file"] {
    padding: 0.5rem;
    background-color: white;
}

/* Custom file input styling */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem 1rem;
    text-align: center;
    background-color: #F9FAFB;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-wrapper:hover {
    border-color: var(--primary);
    background-color: #EEF2FF;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.file-upload-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.file-name-display {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
    word-break: break-all;
}

/* Image Preview */
#imagePreview {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


/* File input standard override */
input[type="file"]::file-selector-button {
    border: none;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 1rem;
}

input[type="file"]::file-selector-button:hover {
    background: var(--primary-hover);
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:hover {
    background-color: var(--primary-hover);
}

.btn:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #F3F4F6;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.alert.success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #34D399;
    display: block;
}

.alert.error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #F87171;
    display: block;
}

/* History List styles */
.history-list {
    margin-top: 2rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.history-item:last-child {
    border-bottom: none;
}

.history-info h4 {
    margin: 0 0 0.2rem 0;
    font-size: 1rem;
    color: var(--text-main);
}

.history-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.empty-state {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
}

.floating-action {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--primary);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
    text-decoration: none;
    transition: transform 0.2s;
    z-index: 100;
}

.floating-action:hover {
    transform: scale(1.1);
}

/* Loader */
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    main {
        padding: 0 1rem 1rem;
    }
    .card {
        padding: 1.2rem;
    }
    .floating-action {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
    }
}
