Compareware/assets/style.css

367 lines
No EOL
6.7 KiB
CSS

/* Variables for non-cell elements */
:root {
--primary: #1e88e5;
--primary-dark: #1565c0;
--text-primary: #333;
--text-secondary: #666;
--background: #f4f4f9;
--card-bg: #ffffff;
--border: #ddd;
--danger: #ff4d4f;
--danger-hover: #ff7875;
--danger-active: #d9363e;
/* Spacing */
--spacing-xs: 4px;
--spacing-sm: 8px;
--spacing-md: 15px;
--spacing-lg: 20px;
--spacing-xl: 30px;
/* Shadows */
--shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
--shadow-lg: 0 8px 12px rgba(0, 0, 0, 0.1);
/* Border radius */
--radius-sm: 4px;
--radius-md: 8px;
--radius-lg: 12px;
--radius-full: 9999px;
}
/* Base styles */
body {
font-family: 'Inter', Arial, sans-serif;
margin: 0;
padding: 0;
background-color: var(--background);
color: var(--text-primary);
line-height: 1.6;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
h1 {
color: var(--primary);
text-align: center;
margin-bottom: var(--spacing-lg);
font-size: 2rem;
letter-spacing: -0.5px;
font-weight: 600;
}
/* Container for better content width control */
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 var(--spacing-md);
}
/* Form styling */
form {
margin: var(--spacing-xl) auto;
max-width: 600px;
padding: var(--spacing-lg);
background: var(--card-bg);
box-shadow: var(--shadow-md);
border-radius: var(--radius-md);
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
form:hover {
box-shadow: var(--shadow-lg);
transform: translateY(-2px);
}
form input, form textarea, form button {
display: block;
width: 100%;
margin-bottom: var(--spacing-md);
padding: var(--spacing-md);
font-size: 16px;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
}
form button {
background-color: var(--primary);
color: white;
border: none;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.1s ease;
font-weight: 600;
}
form button:hover {
background-color: var(--primary-dark);
transform: translateY(-1px);
}
form button:active {
transform: translateY(1px);
}
/* Lists */
ul {
list-style: none;
padding: 0;
}
ul li {
background: var(--card-bg);
margin: var(--spacing-md) 0;
padding: var(--spacing-lg);
border-radius: var(--radius-sm);
box-shadow: var(--shadow-sm);
transition: box-shadow 0.2s ease, transform 0.2s ease;
}
ul li:hover {
box-shadow: var(--shadow-md);
transform: translateY(-2px);
}
/* Tables */
table {
width: 100%;
border-collapse: collapse;
margin: var(--spacing-lg) 0;
box-shadow: var(--shadow-sm);
border-radius: var(--radius-sm);
overflow: hidden;
}
th, td {
border: 1px solid var(--border);
padding: var(--spacing-md);
}
th {
background-color: #f2f2f2;
font-weight: 600;
color: var(--text-primary);
}
tr {
transition: background-color 0.2s ease;
}
tr:hover {
background-color: rgba(30, 136, 229, 0.03);
}
/* Style for the grid container */
.grid-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: 1px;
background-color: #ccc;
border: 1px solid #aaa;
}
/* Style for individual cells */
.editable-cell {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
position: relative;
box-sizing: border-box;
}
/* Style for the input field inside the editable cell */
.editable-cell-input {
width: 100%;
height: 100%;
border: none;
padding: 8px;
box-sizing: border-box;
font-size: 14px;
text-align: left;
outline: none;
background-color: transparent;
}
/* Style for the focused input field */
.editable-cell-input:focus {
background-color: #e0f7fa;
border: 1px solid #00796b;
}
/* Suggestion styling */
.editable-cell-suggestions {
position: absolute;
top: 100%;
left: 0;
width: 100%;
max-height: 200px;
overflow-y: auto;
background-color: white;
border: 1px solid var(--border);
z-index: 10;
box-shadow: var(--shadow-md);
border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.editable-cell-suggestions li {
padding: 8px;
cursor: pointer;
border-bottom: 1px solid #eee;
margin: 0;
box-shadow: none;
transform: none;
border-radius: 0;
}
.editable-cell-suggestions li:hover {
background-color: #f5f5f5;
transform: none;
box-shadow: none;
}
.editable-cell-suggestions li:last-child {
border-bottom: none;
}
/* Textarea */
.editable-cell-textarea {
width: 100%;
height: 100px;
resize: vertical;
overflow: auto;
padding: var(--spacing-md);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
transition: border-color 0.2s ease;
}
.editable-cell-textarea:focus {
outline: none;
border-color: var(--primary);
}
/* Typeahead */
.typeahead-container {
position: relative;
}
.tt-menu {
width: 100%;
background: white;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
box-shadow: var(--shadow-md);
margin-top: 5px;
}
.tt-suggestion {
padding: 8px 12px;
cursor: pointer;
transition: background-color 0.2s ease;
}
.tt-suggestion:hover {
background-color: #f5f5f5;
}
.tt-cursor {
background-color: #e9e9e9;
}
.tt-hint {
display: none !important;
}
.suggestion-item {
padding: 8px 12px;
cursor: pointer;
}
.suggestion-item.tt-cursor {
background-color: #f5f5f5;
}
/* Delete buttons */
.delete-button {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
border-radius: 50%;
border: none;
background-color: var(--danger);
color: white;
font-size: 16px;
font-weight: bold;
cursor: pointer;
margin-left: 8px;
transition: all 0.2s ease;
padding: 0;
line-height: 1;
box-shadow: var(--shadow-sm);
}
.delete-button:hover {
background-color: var(--danger-hover);
transform: scale(1.1);
box-shadow: var(--shadow-md);
}
.delete-button:active {
background-color: var(--danger-active);
transform: scale(0.95);
}
.item-delete {
vertical-align: middle;
}
.property-delete {
vertical-align: middle;
font-size: 14px;
}
/* Button class for consistency */
.button {
display: inline-block;
padding: var(--spacing-sm) var(--spacing-md);
background-color: var(--primary);
color: white;
border: none;
border-radius: var(--radius-sm);
font-weight: 500;
cursor: pointer;
transition: background-color 0.2s ease, transform 0.1s ease;
}
.button:hover {
background-color: var(--primary-dark);
transform: translateY(-1px);
}
.button:active {
transform: translateY(1px);
}
/* Responsive adjustments */
@media (max-width: 768px) {
form {
padding: var(--spacing-md);
}
h1 {
font-size: 1.75rem;
}
}
@media (max-width: 480px) {
form input, form textarea, form button {
padding: var(--spacing-sm);
}
h1 {
font-size: 1.5rem;
}
}