:root {
    --primary: #3498db;
    --secondary: #2c3e50;
    --success: #27ae60;
    --warning: #e74c3c;
    --info: #9b59b6;
    --light: #ecf0f1;
    --dark: #34495e;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-gradient);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Styles */
header {
    text-align: center;
    padding: 30px 0;
    color: white;
    animation: fadeIn 1s ease;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    margin-top: 20px;
}

@media (max-width: 1200px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
}

/* Form Styles */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.form-card h2 {
    color: var(--secondary);
    margin-bottom: 20px;
    font-size: 1.4rem;
    border-bottom: 2px solid var(--light);
    padding-bottom: 10px;
}

.form-card h2 i {
    margin-right: 10px;
    color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

.date-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Button Styles */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: var(--success);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-success:hover {
    background: #219a52;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-warning:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border: 1px solid #ddd;
    padding: 10px 15px;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    margin-top: 8px;
}

.btn-secondary:hover {
    background: #dfe6e9;
}

/* Experience List */
.experience-list {
    margin-top: 15px;
}

.experience-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary);
    display: flex;
    justify-content: between;
    align-items: center;
}

.experience-text {
    flex: 1;
    font-size: 0.9rem;
}

.remove-experience {
    background: var(--warning);
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.remove-experience:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* File Upload */
.file-upload {
    margin-bottom: 10px;
}

.file-upload input {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 10px 15px;
    background: var(--info);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.file-label:hover {
    background: #8e44ad;
}

.signature-preview {
    margin-top: 10px;
    text-align: center;
}

.signature-preview img {
    max-width: 150px;
    max-height: 60px;
    border: 1px dashed #ddd;
    padding: 5px;
}

/* Color Themes */
.color-themes {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.color-option:hover {
    transform: scale(1.2);
}

.color-option.active {
    border-color: white;
    box-shadow: 0 0 0 2px var(--dark);
}

/* Preview Section */
.preview-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--card-shadow);
}

.preview-card h2 {
    color: var(--secondary);
    margin-bottom: 20px;
    font-size: 1.4rem;
    border-bottom: 2px solid var(--light);
    padding-bottom: 10px;
}

.preview-card h2 i {
    margin-right: 10px;
    color: var(--primary);
}

/* Certificate A4 Layout */
.certificate-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

.certificate-a4 {
    width: 210mm;
    min-height: 297mm;
    background: white;
    padding: 25mm;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 1px solid #eee;
}

/* Certificate Header */
.certificate-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.header-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.decoration-left, .decoration-right {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary));
}

.decoration-right {
    background: linear-gradient(90deg, var(--primary), transparent);
}

.decoration-center {
    margin: 0 15px;
    color: var(--primary);
    font-size: 1.5rem;
}

.certificate-header h1 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.header-subtitle {
    font-size: 16px;
    color: var(--dark);
    font-style: italic;
}

/* Certificate Body */
.certificate-body {
    margin: 30px 0;
}

.employee-name {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin: 20px 0;
    color: var(--secondary);
    padding: 10px;
    border-bottom: 2px solid var(--light);
}

.employee-details {
    font-size: 14px;
    line-height: 1.8;
}

.employee-details p {
    margin-bottom: 15px;
    text-align: justify;
}

.employee-details ul {
    margin: 15px 0 15px 30px;
}

.employee-details li {
    margin-bottom: 8px;
}

/* Certificate Footer */
.certificate-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 2px solid var(--light);
}

.signature-section {
    text-align: center;
    flex: 1;
}

.signature-placeholder {
    margin-bottom: 10px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.signature-line {
    width: 200px;
    height: 1px;
    background: var(--dark);
    margin: 0 auto;
}

.issuer-details {
    margin-top: 10px;
}

.issuer-details div:first-child {
    font-weight: 600;
    margin-bottom: 5px;
}

.issuer-details div:last-child {
    font-style: italic;
    color: #666;
}

.date-section {
    text-align: right;
    flex: 1;
}

.date-label {
    font-weight: 600;
    margin-bottom: 5px;
}

/* Border Decorations */
.border-decoration {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 2px solid var(--primary);
    opacity: 0.3;
}

.top-left {
    top: 15px;
    left: 15px;
    border-right: none;
    border-bottom: none;
}

.top-right {
    top: 15px;
    right: 15px;
    border-left: none;
    border-bottom: none;
}

.bottom-left {
    bottom: 15px;
    left: 15px;
    border-right: none;
    border-top: none;
}

.bottom-right {
    bottom: 15px;
    right: 15px;
    border-left: none;
    border-top: none;
}

/* Preview Actions */
.preview-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* AI Panel */
.ai-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--card-shadow);
}

.ai-panel h3 {
    color: var(--info);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.ai-panel h3 i {
    margin-right: 8px;
}

.suggestions-list {
    display: grid;
    gap: 10px;
}

.suggestion-item {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid var(--info);
    font-size: 0.9rem;
}

.suggestion-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.suggestion-item i {
    margin-right: 8px;
    color: var(--info);
}

/* Floating Actions */
.floating-actions {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: float 3s ease-in-out infinite;
}

.fab:nth-child(2) {
    animation-delay: 0.5s;
    background: var(--success);
}

.fab:nth-child(3) {
    animation-delay: 1s;
    background: var(--info);
}

.fab:hover {
    transform: scale(1.1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .certificate-a4 {
        padding: 15mm;
        transform: scale(0.9);
    }
    
    .preview-actions {
        flex-direction: column;
    }
    
    .certificate-footer {
        flex-direction: column;
        gap: 20px;
    }
    
    .date-section {
        text-align: center;
    }
}