/* Font: Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --ag-primary: #2563eb;
    --ag-primary-hover: #1d4ed8;
    --ag-bg: #f8fafc;
    --ag-card-bg: #ffffff;
    --ag-text-main: #1e293b;
    --ag-text-muted: #64748b;
    --ag-border: #e2e8f0;
    --ag-radius: 12px;
    --ag-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.agmad-tool {
    font-family: 'Inter', sans-serif;
    max-width: 900px;
    margin: 40px auto;
    color: var(--ag-text-main);
}

/* Header */
.agmad-tool-header {
    text-align: center;
    margin-bottom: 32px;
}

.agmad-tool-header h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.agmad-tool-header p {
    font-size: 18px;
    color: var(--ag-text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Card / Body */
.agmad-tool-body {
    background: var(--ag-card-bg);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius);
    padding: 32px;
    box-shadow: var(--ag-shadow);
}

/* Drop Zone */
.agmad-drop {
    border: 2px dashed var(--ag-border);
    border-radius: var(--ag-radius);
    padding: 40px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s ease;
    cursor: pointer;
}

.agmad-drop:hover,
.agmad-drop.drag-over {
    border-color: var(--ag-primary);
    background: #eff6ff;
}

.agmad-drop p {
    font-size: 16px;
    color: var(--ag-text-muted);
    margin: 0;
}

.agmad-browse {
    color: var(--ag-primary);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.agmad-browse:hover {
    text-decoration: underline;
}

/* Controls & Inputs */
.agmad-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin: 24px 0;
    padding: 20px;
    background: #f1f5f9;
    border-radius: var(--ag-radius);
}

.agmad-controls label {
    font-weight: 500;
    font-size: 14px;
    color: var(--ag-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="number"],
input[type="text"],
select,
.agmad-textarea {
    padding: 10px 14px;
    border: 1px solid var(--ag-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--ag-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.agmad-textarea {
    width: 100%;
    resize: vertical;
    line-height: 1.5;
}

/* Buttons */
.agmad-btn {
    background: var(--ag-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.agmad-btn:hover {
    background: var(--ag-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.agmad-btn:active {
    transform: translateY(0);
}

/* Secondary Button Style (optional usage) */
.agmad-btn.secondary {
    background: white;
    color: var(--ag-text-main);
    border: 1px solid var(--ag-border);
}

.agmad-btn.secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Results Area */
.agmad-results {
    margin-top: 24px;
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .agmad-results {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Cards in Results */
.agmad-card {
    background: white;
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}

.agmad-card:hover {
    border-color: #cbd5e1;
}

.agmad-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    background: #f1f5f9;
}

.agmad-note {
    font-size: 13px;
    color: var(--ag-text-muted);
    margin-top: 4px;
}

.agmad-actions {
    margin-left: auto;
}

/* Grid Shortcode */
.ag-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    padding: 20px 0;
}

.ag-card {
    background: white;
    border: 1px solid var(--ag-border);
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    color: var(--ag-text-main);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.ag-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--ag-primary);
}

.ag-emoji {
    font-size: 32px;
    margin-bottom: 16px;
}

.ag-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
}

.ag-card p {
    margin: 0 0 16px;
    color: var(--ag-text-muted);
    font-size: 14px;
    flex-grow: 1;
}

.ag-tag {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 99px;
    background: #f1f5f9;
    color: var(--ag-text-muted);
}

/* Utilities */
.agmad-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.agmad-colors code {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    color: #0f172a;
}

.agmad-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--ag-text-muted);
}