﻿/*This css file is for invoice builder page and the default invoice.*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    color: #ffffff;
    overflow-x: hidden;
/*    padding: 2rem;*/
}

/* Top Level Controls */
.top-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin: 6rem 2rem 0rem 2rem;
}

.template-section {
    display: flex;
    align-items: center;
    flex-wrap:wrap;
    gap: 1rem;
}

.template-label {
    color: #00d4ff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.template-dropdown {
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

    .template-dropdown:focus {
        outline: none;
        border-color: #00d4ff;
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    }

    .template-dropdown option {
        background: #1a1a2e;
        color: #ffffff;
    }

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap:wrap;
}

.action-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-btn {
    background: linear-gradient(45deg, #ff00ff, #cc0099);
    color: white;
}

    .download-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(255, 0, 255, 0.4);
    }

.copy-btn {
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    color: white;
}

    .copy-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 212, 255, 0.4);
    }

.btn-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

/* Left Side - Invoice Builder */
.builder-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.builder-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.builder-title {
    font-size: 2rem;
    background: linear-gradient(45deg, #00d4ff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.3rem;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.builder-subtitle {
    color: #a0a0a0;
    font-size: 0.9rem;
}

/* Form Styling */
.form-group {
    margin-bottom: 0.8rem;
}

.form-label {
    display: block;
    margin-bottom: 0.3rem;
    color: #00d4ff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

    .form-input:focus,
    .form-select:focus {
        outline: none;
        border-color: #00d4ff;
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
        transform: translateY(-1px);
    }

    .form-input::placeholder {
        color: #666;
    }

.form-select {
    cursor: pointer;
}

    .form-select option {
        background: #1a1a2e;
        color: #ffffff;
    }

/* Invoice Number Input with Regenerate Button */
.invoice-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.invoice-input {
    flex: 1;
    padding-right: 45px;
}

.regenerate-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .regenerate-btn:hover {
        transform: translateY(-50%) scale(1.1);
        box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
    }

.regenerate-icon {
    width: 16px;
    height: 16px;
    fill: white;
}

/* Logo Upload Styling */
.logo-upload-container {
    position: relative;
    border: 2px dashed rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

    .logo-upload-container:hover {
        border-color: #00d4ff;
        background: rgba(0, 212, 255, 0.05);
    }

    .logo-upload-container.has-image {
        border-style: solid;
        border-color: #00d4ff;
    }

.logo-upload-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.logo-upload-text {
    color: #a0a0a0;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.logo-preview {
    max-width: 100px;
    max-height: 60px;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.form-row-triple {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 0.8rem;
}

.add-item-btn {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
}

    .add-item-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 212, 255, 0.4);
    }

/* Section Headers */
.section-header {
    font-size: 1rem;
    color: #ff00ff;
    margin: 1.5rem 0 0.8rem 0;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid rgba(255, 0, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

    .section-header:first-of-type {
        margin-top: 0;
    }

/* Product List Styling */
.product-list {
    margin-top: 1rem;
}

.product-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    position: relative;
}

.product-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
    gap: 0.5rem;
    align-items: center;
    min-width: 0;
}
.product-input-container {
    position: relative
}

    .product-input-container .error-message {
        position: absolute;
        bottom: -13px;
        left: 0;
        font-size: 11px;
        color: #e63946;
        animation: fadeIn 0.4s ease;
    }

.product-input {
    padding: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 5px;
    color: #ffffff;
    font-size: 0.8rem;
    min-width: 0;
    width: 100%;
}

    .product-input:focus {
        outline: none;
        border-color: #00d4ff;
    }

.error-input {
    border: 1px solid #e63946;
    animation: wobble 0.6s ease;
}

/* Delete button styling */
.delete-btn {
    background: linear-gradient(45deg, #ff4757, #ff3742);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

    .delete-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
    }

.delete-icon {
    width: 14px;
    height: 14px;
    fill: white;
}

/* Right Side - Invoice Preview */
.invoice-preview-wrapper {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.invoice-section {
    width: 100%;
    min-height: 297mm;

    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    color: #333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

    .invoice-section::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 5px;
        background: linear-gradient(90deg, #00d4ff, #ff00ff, #00d4ff);
        animation: shimmer 2s ease-in-out infinite;
    }

@keyframes shimmer {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes wobble {
    0% {
        transform: translateX(0);
    }

    15% {
        transform: translateX(-5px);
    }

    30% {
        transform: translateX(5px);
    }

    45% {
        transform: translateX(-5px);
    }

    60% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-3px);
    }

    90% {
        transform: translateX(3px);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.company-info {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    flex: 1;
}

/* Enhanced Logo Container */
.company-logo-container {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
/*    background: linear-gradient(135deg, #00d4ff15, #ff00ff15);*/
/*    border: 2px solid rgba(0, 212, 255, 0.2);*/
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

    .company-logo-container:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 25px rgba(0, 212, 255, 0.2);
        border-color: #00d4ff;
    }

.company-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    transition: all 0.3s ease;
}

/* Futuristic Logo Placeholder */
.logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

    .logo-placeholder::before {
        content: "";
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient(45deg, transparent, rgba(0, 212, 255, 0.1), transparent);
        animation: scan 3s linear infinite;
    }

@keyframes scan {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.logo-placeholder-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    opacity: 0.6;
    z-index: 2;
    position: relative;
}

.logo-placeholder-text {
    font-size: 8px;
    color: #00d4ff;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    z-index: 2;
    position: relative;
    text-align: center;
    line-height: 1.2;
}

.company-details {
    flex: 1;
    min-width: 0;
}

    .company-details h1 {
        font-size: 1.8rem;
        color: #1a1a2e;
        margin-bottom: 0.5rem;
        background: linear-gradient(45deg, #1a1a2e, #00d4ff);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        font-weight: 700;
        word-wrap: break-word;
    }

    .company-details p {
        color: #666;
        margin: 0.1rem 0;
        font-size: 0.9rem;
        word-wrap: break-word;
    }

.invoice-number {
    text-align: right;
    flex-shrink: 0;
    min-width: 180px;
}

    .invoice-number h2 {
        color: #00d4ff;
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
        text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
        word-wrap: break-word;
    }

.invoice-date {
    color: #666;
    font-size: 0.9rem;
}

.client-info {
    margin-bottom: 1.5rem;
}

    .client-info h3 {
        color: #1a1a2e;
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
    }

    .client-info p {
        margin: 0.1rem 0;
        font-size: 0.9rem;
    }

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
}

    .items-table th {
        background: linear-gradient(45deg, #1a1a2e, #16213e);
        color: white;
        padding: 0.8rem 0.5rem;
        text-align: left;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        font-size: 0.75rem;
    }

    .items-table td {
        padding: 0.6rem 0.5rem;
        border-bottom: 1px solid #eee;
    }

    .items-table tr:hover {
        background: rgba(0, 212, 255, 0.05);
    }

    .items-table td:last-child,
    .items-table th:last-child {
        text-align: right;
    }

.total-section {
    margin-left: auto;
    width: 280px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

    .total-row:last-child {
        border-bottom: none;
        font-size: 1.2rem;
        font-weight: bold;
        color: #00d4ff;
        border-top: 2px solid #00d4ff;
        padding-top: 0.8rem;
        margin-top: 0.8rem;
    }

.total-label {
    font-weight: 600;
}

.total-amount {
    font-weight: 600;
}

/* Glow effects */
.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    }

    to {
        text-shadow: 0 0 30px rgba(0, 212, 255, 0.8);
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        align-items: center;
    }

    .builder-section,
    .invoice-preview-wrapper {
        width: 100%;
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    .top-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .template-section {
        justify-content: center;
    }

    .action-buttons {
        justify-content: center;
    }

    .invoice-header {
        flex-direction: column;
        gap: 1rem;
    }

    .company-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .invoice-number {
        text-align: center;
        min-width: auto;
    }
}

/* Success message styling */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.4);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

    .success-message.show {
        opacity: 1;
        transform: translateX(0);
    }
